^NoneNone +autom. Kantenfinder Bitmaps\Bildschirm3.bmpLabel䞵%+.4fMNoneNone 0autom. Kantenfinder Bitmaps\Bildschirm_unten.bmpLabel쫵%+.4fM NoneNone 0autom. Kantenfinder Bitmaps\G-Code Befehle_2.bmpNone%+.4f1 NoneNone &autom. Kantenfinder Bitmaps\M-Code.bmpNone%+.4f.ErrorNone NoneError%+.4f'lModeNone NoneMode%+.4fQeNoneNone &autom. Kantenfinder Bitmaps\G-Code.bmpNone%+.4f NoneNone NoneNone%+.4f NoneNone NoneNone%5.0fnImpuls-FrequenzNone NoneImpuls-Frequenz%+.4fy8NoneNone NoneNone5%+.4f 8NoneNone NoneLabel6%+.4f 8NoneNone NoneLabel7%+.4f 8NoneNone NoneLabel8%+.4f 8NoneNone NoneLabel9%+.4f 8NoneNone NoneLabel:%+.4f Input #1None NoneInput #1%+.4fUInput #2None NoneInput #2%+.4fUInput #3None NoneInput #3%+.4fUInput #4None NoneInput #4%+.4fUProbeNone NoneProbe%+.4fUIndexNone NoneIndex%+.4fU8NoneNone NoneLabel;%+.4f  8NoneNone NoneNone<%+.4fXh8NoneNone NoneLabel?%+.4fXh8NoneNone NoneNoneB%+.4fXh8NoneNone NoneNoneE%+.4fXh Limit OvrdNone None Limit Ovrd%+.4fUX ++None NoneX ++%+.4foY ++None NoneY ++%+.4foZ ++None NoneZ ++%+.4foA ++None NoneA ++%+.4fo8NoneNone NoneNone=%+.4f8NoneNone NoneNone@%+.4f8NoneNone NoneNoneC%+.4f8NoneNone NoneNoneF%+.4fX --None NoneX --%+.4fY --None NoneY --%+.4fZ --None NoneZ --%+.4fA --None NoneA --%+.4f8NoneNone NoneNone>%+.4f&8NoneNone NoneNoneA%+.4f&8NoneNone NoneNoneD%+.4f&8NoneNone NoneNoneG%+.4f&X HomeNone NoneX Home%+.4f-gY HomeNone NoneY Home%+.4f-gZ HomeNone NoneZ Home%+.4f-gA HomeNone NoneA Home%+.4f-gEingangssignale None NoneEingangssignale %+.4fgi8NoneNone NoneNoneN%+.4fe uEnable 1None NoneEnable 1%+.4feKu8NoneNone NoneNoneT%+.4f  Output #1None None Output #1%+.4fR8NoneNone NoneNoneU%+.4fXh Output #2 None None Output #2 %+.4fo8NoneNone NoneNoneV%+.4f Output #3None None Output #3%+.4f8NoneNone NoneNoneW%+.4f  Digit TrigNone None Digit Trig%+.4fKAusgangssignaleNone NoneAusgangssignale%+.4fg<U8NoneNone NoneLabel%+.4f EStopNone NoneEStop%+.4fU  PWM-FrequenzNone None PWM-Frequenz%+.4fyfx NoneNone NoneNone%+4.0ffn NoneNone NoneNone5%.0fnCPU TaktNone NoneCPU Takt%+.4fyMHzNone NoneMHz%+.4fr Output #4None None Output #4%+.4fR8NoneNone NoneNoneM%+.4f 8NoneNone NoneNoneN%+.4fXh Output #5None None Output #5%+.4fo8NoneNone NoneLabelO%+.4f Output #6None None Output #6%+.4f NoneNone Nones%+.4fL8NoneNone NoneNone %+.4f NoneNone Nonep%+.4fQ NoneNone None q%+.4fX NoneNone Noner%+.4f NoneNone None%+.4fO h NoneNone None %+.4fOth NoneNone None%+.4fjt NoneNone None%+.4fxkNoneNone None5 %+.4fT_8NoneNone NoneNone %+.4fP_ NoneNone None%+.4fj8NoneNone NoneNone!%+.4fk NoneNone 'autom. Kantenfinder Bitmaps\ein_aus.bmpNoneq%+.4f= NoneNone 'autom. Kantenfinder Bitmaps\ein_aus.bmpNoner%+.4f=SpindelNone NoneSpindel%+.4f_Khlung SchwallNone NoneKhlung Schwall%+.4f_ Khlung NebelNone None Khlung Nebel%+.4f_NoneNone /autom. Kantenfinder Bitmaps\xachse_referenz.bmpNone%+.4fyNoneNone /autom. Kantenfinder Bitmaps\yachse_referenz.bmpNone%+.4fyNoneNone /autom. Kantenfinder Bitmaps\zachse_referenz.bmpNone%+.4fyNoneNone /autom. Kantenfinder Bitmaps\4achse_referenz.bmpNone%+.4fy)8NoneNone NoneNone'%+.4f8NoneNone NoneNone(%+.4f8NoneNone NoneNone)%+.4f8NoneNone NoneNone*%+.4f) NoneNone NoneNone%+.4fWerkstck-Offset Nr.None NoneWerkstck-Offset Nr.%+.4fT NoneNone NoneNone.%.0fZ NoneNone NoneNone%+.4f 38NoneNone NoneNone%+.4f8NoneNone NoneNone%+.4fNoneNone NoneNone%+.3f\NoneNone NoneNone%+.3fNoneNone NoneNone%+.3fNoneNone NoneNone%+.3fNoneNone None%+.4f\NoneNone None%+.4fNoneNone None%+.4fNoneNone None%+.4fSkal.None NoneSkal.%+.4f\k NoneNone NoneNone;%+.2fo8NoneNone NoneNone)%+.4f\l8NoneNone NoneNone*%+.4f NoneNone NoneNone<%+.2fSkal.None NoneSkal.%+.4f8NoneNone NoneNone+%+.4f NoneNone NoneNone=%+.2fSkal.None NoneSkal.%+.4fNoneNone None%+.4fY|8NoneNone NoneNone'%+.4f[~8NoneNone NoneNone(%+.4f8NoneNone NoneNone)%+.4f8NoneNone NoneNone*%+.4f NoneNone None%+.4f NoneNone None%+.4fRad.None NoneRad.%+.4f KorrekturNone None Korrektur%+.4f8NoneNone NoneNone%+.4f NoneNone None%+.4f8Q"None$SetUserDRO(1210,2) DoOEMButton(7) None%+.4fc8Q8NoneNone NoneNone/%+.4f@8HQ NoneNone None%+.4f8<QNoneNone NoneNone%.0flK_NummerNone NoneNummer%+.4f KQ] DurchmesserNone None Durchmesser%+.4f cnuNoneNone NoneNone%+.2flcvWechselnNone NoneWechseln%+.4f {Z8NoneNone NoneNone&%+.4fl{"None$SetOEMDRO(1215,2) DoOEMButton(11) NoneV%+.4f +"NoneCode "G92.2" Gage_Block = GetOEMDRO(1201) if Gage_Block > 0 then Message "Achtung: Distanzstck ist gesetzt" PlayWave "C:\Mach3\Bitmaps\SeligBitmaps\Hinweis.wav" end if New_Pos = Gage_Block Call SetOEMDRO(2, New_Pos) NoneZ%+.4fNoneNone &autom. Kantenfinder Bitmaps\slider.bmpSkinnedbSTDL10H310%3.0f(kK NoneNone Nonel%+.4f(EKh NoneNone Nonem%+.4f(K( NoneNone NoneM%+.4f( NoneNone NoneP%+.4fEh NoneNone &autom. Kantenfinder Bitmaps\slider.bmpSkinnedJbSTDL10H310%3.0fkNoneNone NoneNone%.0f NoneNone NoneNone7%.0f'mm/min.None Nonemm/min.%+.4fist:None Noneist:%+.4f#soll:None Nonesoll:%+.4f8NoneNone NoneNone!%+.4f Zoll/min.None None Zoll/min.%+.4f8NoneNone NoneNone"%+.4f8NoneNone NoneNone%+.4fF_ NoneNone NoneNone1%.0f NoneNone NoneNone%.0f NoneNone NoneNone'%.0f_'soll:None Nonesoll:%+.4f^ist:None Noneist:%+.4f^z RckmeldungNone None Rckmeldung%+.4f^"NoneNone Nonen{%+.4f^E^NoneNone None%+.4fC\ NoneNone None%+.4f^c|8NoneNone NoneNone%+.4fF_"None@Code "G0G53Z" & GetOEMDRO(54) Code "G0 X0 Y0" Code "G0 Z0" None%+.4f NoneNone Nonew%+.4f"None Code "G0G53 Z" & GetOEMDRO(54) NoneB%+.4f"NoneXpos = GetOEMDRO(1205) Ypos = GetOEMDRO(1206) Zpos = GetOEMDRO(1207) Code "G0G53 Z" & GetOEMDRO(54) Code "G0G53X" & XPos Code "G0G53Y" & Ypos Code "G0G53Z" & ZPos None %+.4f"NoneDoButton(24) DoButton(23) DoButton(22) DoButton(25) SetOEMDRO 80,0 DOOEMButton 219 SetUserLED 1050,0 SetUserLED 1054,0 SetUserLED 1051,0 None%+.4f} NoneNone None%+.4f"NoneOpenTeachFile "MDITeach.tap" None%+.4f"NoneCloseTeachFile None%+.4fO"None"DoOEMButton(228) DoOEMButton(1) None%+.4fX8NoneNone NoneNoneJ%+.4f NoneNone NoneNone%+.4f&H"None>SetOEMDRO(1216,GetOEMDRO(83)) SetOEMDRO(1217,GetOEMDRO(84)) NoneO%+.4f"NonebCode "G0G53 Z" & GetOEMDRO(54) Code "G0G53X" & GetOEMDRO(1216) Code "G0G53Y" & GetOEMDRO(1217) NoneRq%+.4f Breite DistanzstckNone NoneBreite Distanzstck%+.4f55EDurchmesser TasterNone NoneDurchmesser Taster%+.4f6/8NoneNone NoneNone%+.4fH[c NoneNone None%+.4fG9WHheNone NoneHhe%+.4fGr DistanzstckNone None Distanzstck%+.4fG NoneNone NoneNone%.3fG NoneNone Noney%+.4fG+I"NoneTool_Num = GetDRO (24) If Tool_Num <>0 then Z_Shift = GetOEMDRO (1201) Axis_Pos = GetOEMDRO(85) Tool_Offset = Axis_Pos -Z_Shift Call setOEMDRO(42, Tool_Offset) End if None%+.4fG1OffsetNone NoneOffset%+.4fGt NoneNone NoneNone*%+.3f~"NoneXpos = GetOEMDRO(1202) Ypos = GetOEMDRO(1203) SetOEMDRO(1216,GetOEMDRO(800)) SetOEMDRO(1217,GetOEMDRO(801)) Code "G0G53Z" & GetOEMDRO(54) Code "G0G53X" & XPos Code "G0G53Y" & YPos None0 %+.4fHf"None$SetOEMDRO(1215,3) DoOEMButton(11) NoneV%+.4fG "NoneaCode "G0G53Z" & GetOEMDRO(54) Code "G0G53X" & GetOEMDRO(1216) Code "G0G53Y" & GetOEMDRO(1217) NoneR%+.4fGNoneNone NoneNone%.2fcw DurchmesserNone None Durchmesser%+.4fGdvNummerNone NoneNummer%+.4fGH\ NoneNone NoneNone8%.0fE^ NoneNone NoneNone.%.0f":;!NoneG59 None%+.4f<!NoneG58 None%+.4f;!NoneG57 None%+.4f<!NoneG56 None%+.4fu<!NoneG55 None%+.4fZ<s!NoneG54 None%+.4f?<X NoneNone None%+.4f NoneNone NoneNone2%+.3f% NoneNone NoneNone1%+.3f% NoneNone NoneNone0%+.3f%h NoneNone NoneNone/%+.3f%Be NoneNone None%+.4f NoneNone None%+.4f NoneNone None%+.4fi8NoneNone NoneNone%+.4fCN8NoneNone NoneNone)%+.4fCN8NoneNone NoneNone(%+.4fCiN8NoneNone NoneNone'%+.4fCBNeNoneNone None%+.4f@NoneNone None%+.4fi@NoneNone None%+.4f@NoneNone None%+.4fB@eNoneNone NoneNone%+.3fPNoneNone NoneNone%+.3fPNoneNone NoneNone%+.3fPiNoneNone NoneNone%+.3fQBe NoneNone NoneNonep%+.2f'1"NoneIf GetOEMLED(1090) Then SetOEMDRO(47, 0) Position = GetOEMDRO(83) Code "G01 G53 X" & Position -0.2 & "F50" While IsMoving() Wend Position = GetOEMDRO(83) Code "G31 X" & (Position + 5) & "F50" While IsMoving() Wend Position = GetOEMDRO(83) Code "G01 G53 X" & Position -0.2 & "F50" While IsMoving() Wend Position = GetOEMDRO(83) Code "G31 X" & (Position + 0.5) & "F5" While IsMoving() Wend End If Call SetOEMDRO(800, GetOEMDRO(1000)/-(2)-GetOEMDRO(1209)) Call SetUserLED(1090,0) NoneX%+.4fPs"NoneIf GetOEMLED(1090) Then SetOEMDRO(47, 0) Position = GetOEMDRO(83) Code "G01 G53 X" & Position +0.2 & "F50" While IsMoving() Wend Position = GetOEMDRO(83) Code "G31 X" & (Position - 5) & "F50" While IsMoving() Wend Position = GetOEMDRO(83) Code "G01 G53 X" & Position +0.2 & "F50" While IsMoving() Wend Position = GetOEMDRO(83) Code "G31 X" & (Position - 0.5) & "F5" While IsMoving() Wend End If Call SetOEMDRO(800, GetOEMDRO(1000)/(2)-GetOEMDRO(1209)) Call SetUserLED(1090,0) None%+.4f&"NoneIf GetOEMLED(1090) Then SetOEMDRO(48, 0) Position = GetOEMDRO(84) Code "G01 G53 Y" & Position -0.2 & "F50" While IsMoving() Wend Position = GetOEMDRO(84) Code "G31 Y" & (Position + 5) & "F50" While IsMoving() Wend Position = GetOEMDRO(84) Code "G01 G53 Y" & Position -0.2 & "F50" While IsMoving() Wend Position = GetOEMDRO(84) Code "G31 Y" & (Position + 0.5) & "F5" While IsMoving() Wend End If Call SetOEMDRO(801, GetOEMDRO(1000)/-(2)-GetOEMDRO(1209)) Call SetUserLED(1090,0) NoneY%+.4f"NoneIf GetOEMLED(1090) Then SetOEMDRO(48, 0) Position = GetOEMDRO(84) Code "G01 G53 Y" & Position +0.2 & "F50" While IsMoving() Wend Position = GetOEMDRO(84) Code "G31 Y" & (Position - 5) & "F50" While IsMoving() Wend Position = GetOEMDRO(84) Code "G01 G53 Y" & Position +0.2 & "F50" While IsMoving() Wend Position = GetOEMDRO(84) Code "G31 Y" & (Position - 0.5) & "F5" While IsMoving() Wend End If Call SetOEMDRO(801, GetOEMDRO(1000)/(2)-GetOEMDRO(1209)) Call SetUserLED(1090,0) None%+.4f1T"NonemSub Main() If GetUSERLED(1090) Then If GetUserLED(1091) Then 'Auen messen SicherZ = GetOEMDRO(1001) If SicherZ = 0 Then MsgBox("Sichere Z-Hhe darf nicht Null sein") Exit Sub End If N$ = InputBox$("Durchmesser des Werkstcks? Achtung! Beschdigungen von Maschine, Werstck und Werkzeug mglich.", "Automatisch Zentrieren", "", 500, 350) Durchmesser = CDbl(N$) If Durchmesser = 0 Then Exit Sub SetOEMDRO(47, 0) SetOEMDRO(48, 0) Spitze = GetOEMDRO(1000) HheZ = GetOEMDRO(85) Vorschub = 200 Code "F" & Vorschub Code "G31 X" & GetOEMDRO(83)+Spitze*1.5 'von X- messen While IsMoving() Wend KontaktXMinus = GetOEMDRO(83) Code "G53 G0 Z" & HheZ+SicherZ 'hochfahren Code "G53 G0 X" & KontaktXMinus+Durchmesser+Spitze*1.5 'auf die andere Seite Code "G53 G0 Z" & HheZ 'runterfahren KontaktXPlus = GetOEMDRO(83) 'aktuelle Position X Code "G31 X" & KontaktXPlus-Spitze*2 'von X+ messen While IsMoving() Wend KontaktXPlus = GetOEMDRO(83) ZentrumX = (KontaktXPlus-KontaktXMinus)/2+KontaktXMinus 'Zentrum X Code "G53 G0 Z" & HheZ+SicherZ 'hochfahren Code "G53 G0 X" & ZentrumX 'auf die Mitte Code "G53 G0 Y" & GetOEMDRO(84)-Durchmesser/2-Spitze 'auf Y- Code "G53 G0 Z" & HheZ 'runterfahren KontaktYMinus = GetOEMDRO(84) Code "G31 Y" & KontaktYMinus+Spitze*1.5 'von X- messen While IsMoving() Wend KontaktYMinus = GetOEMDRO(84) Code "G53 G0 Z" & HheZ+SicherZ 'hochfahren Code "G53 G0 Y" & GetOEMDRO(84)+Durchmesser+Spitze*1.5 'auf Y+ Code "G53 G0 Z" & HheZ 'runterfahren KontaktYPlus = GetOEMDRO(84) Code "G31 Y" & KontaktYPlus-Spitze*2 'von Y+ messen While IsMoving() Wend KontaktYPlus = GetOEMDRO(84) ZentrumY = (KontaktYPlus-KontaktYMinus)/2+KontaktYMinus 'Zentrum Y Code "G53 G0 Z" & HheZ+SicherZ 'hochfahren Code "G53 G0 X" & ZentrumX & "Y" & ZentrumY 'ins Zentrum fahren Code "G53 G0 X" & ZentrumX-Durchmesser/2-Spitze 'auf X- Code "G53 G0 Z" & HheZ 'runterfahren Code "G31 X" & GetOEMDRO(83)+Spitze*1.5 'von X- messen While IsMoving() Wend KontaktXMinus = GetOEMDRO(83) Code "G53 G0 Z" & HheZ+SicherZ 'hochfahren Code "G53 G0 X" & KontaktXMinus+Durchmesser+Spitze*1.5 'auf die andere Seite Code "G53 G0 Z" & HheZ 'runterfahren KontaktXPlus = GetOEMDRO(83) 'aktuelle Position X Code "G31 X" & KontaktXPlus-Spitze*2 'von X+ messen While IsMoving() Wend KontaktXPlus = GetOEMDRO(83) ZentrumX = (KontaktXPlus-KontaktXMinus)/2+KontaktXMinus 'Zentrum X Code "G53 G0 Z" & HheZ+SicherZ 'hochfahren While IsMoving() Wend Code "G53 G0 X" & ZentrumX 'auf Zentrum X fahren While IsMoving() Wend Else N$ = InputBox$("Ungefhrer Durchmesser der Bohrung? Achtung! Beschdigungen von Maschine, Werstck und Werkzeug mglich.", "Automatisch Zentrieren", "", 500, 350) Durchmesser = CDbl(N$) If Durchmesser = 0 Then Exit Sub SetOEMDRO(47, 0) SetOEMDRO(48, 0) RadiusBohrung = Durchmesser/2 Spitze = GetOEMDRO(1000) TastRadius = RadiusBohrung + Spitze ZentrumX = GetOEMDRO(83) ZentrumY = GetOEMDRO(84) Vorschub = 200 Code "F" & Vorschub Code "G31 X" & ZentrumX + Tastradius 'Messen X+ While IsMoving() Wend KontaktXPlus = GetOEMDRO(83) Code "G53 G0 X" & ZentrumX While IsMoving() Wend Code "G31 X" & ZentrumX - Tastradius 'Messen X- While IsMoving() Wend KontaktXMinus = GetOEMDRO(83) ZentrumX = (KontaktXPLus + KontaktXMinus)/2 Code "G53 G0 X" & ZentrumX While IsMoving() Wend Code "G31 Y" & ZentrumY + Tastradius 'Messen Y+ While IsMoving() Wend KontaktYPlus = GetOEMDRO(84) Code "G53 G0 Y" & ZentrumY While IsMoving() Wend Code "G31 Y" & ZentrumY - Tastradius 'Messen Y- While IsMoving() Wend KontaktYMinus = GetOEMDRO(84) ZentrumY = (KontaktYPLus + KontaktYMinus)/2 Code "G53 G0 Y" & ZentrumY While IsMoving() Wend Code "G31 X" & ZentrumX + Tastradius 'Messen X+ While IsMoving() Wend KontaktXPlus = GetOEMDRO(83) Code "G53 G0 X" & ZentrumX Code "G31 X" & ZentrumX - Tastradius 'Messen X- While IsMoving() Wend KontaktXMinus = GetOEMDRO(83) ZentrumX = (KontaktXPLus + KontaktXMinus)/2 Code "G53 G0 X" & ZentrumX While IsMoving() Wend End If Call SetOEMDRO(800,0) Call SetOEMDRO(801,0) SetUserLED(1090, 0) SetUserLED(1091, 0) End If DoOEMButton(1008) DoOEMButton(1009) SetUserLED(1090, 0) End Sub None%+.4fuU8NoneNone NoneNone%+.4f  NoneNone Nonez%+.4f;"None Code "G0G53 Z" & GetOEMDRO(54) NoneB%+.4fG NoneNone NoneNone%+.3f NoneNone NoneNone%+.3f NoneNone NoneNone%+.3f NoneNone NoneNone%+.3f_x NoneNone NoneNone%+.3fD]Wechselposition None NoneWechselposition Z %+.4fVhNoneNone NoneYZ %+.4fbt Parkposition None None Parkposition %+.4f|NoneNone NoneX%+.4fGYXNone NoneXZ %+.4fYNone NoneYZ %+.4fZNone NoneZZ %+.4f"None>SetOEMDRO(1202,GetOEMDRO(83)) SetOEMDRO(1203,GetOEMDRO(84)) None\_ %+.4f~"None]SetOEMDRO(1205,GetOEMDRO(83)) SetOEMDRO(1206,GetOEMDRO(84)) SetOEMDRO(1207,GetOEMDRO(85)) None\_ %+.4f NoneNone NoneMaschinenkoordinaten!%+.4f2@NoneNone NoneNone%+.3f~Radius Achse 4None NoneRadius Achse 4%+.4fs NoneNone NoneNone8%.0fE^ NoneNone NoneNone9%.0fc|Maximale DrehzahlNone NoneMaximale Drehzahl%+.4ffxbersetzungsstufe Nr.None Nonebersetzungsstufe Nr.%+.4fHZ NoneNone None~ %+.4f8NoneNone NoneNoneQ%+.4f NoneNone NoneNone\%.0f $ NoneNone NoneNone]%.3f)BWinkel maximalNone NoneWinkel maximalps\%+.4fs!NoneNone None Anheben um%+.4f,n> Rckzug umNone None Rckzug um%+.4fn NoneNone NoneNone[%.3f NoneNone NoneNone%.3f5'GFileNone NoneFile%+.4f:Befehl:None NoneBefehl:%+.4fy8NoneNone NoneNoneH%+.4f 8NoneNone NoneNoneI%+.4f)"NoneCode "G92.2" Gage_Block = GetOEMDRO(1201) if Gage_Block > 0 then Message "Achtung: Distanzstck ist gesetzt" PlayWave "C:\Mach3\Bitmaps\SeligBitmaps\Hinweis.wav" end if New_Pos = Gage_Block Call SetOEMDRO(802, New_Pos) NoneNoneZ Gag%+.4fG8NoneNone NoneNoneB%+.4fl/vE"NoneIf Not GetOEMLED(1090) Then SetUserLED (1090, 1) Else SetUserLED (1090, 0) SetUserLED (1091, 0) End If NoneNone%+.4f%/gE@Rel. 3.32 Bildschirmdesign Copyright Christoph Selig 2006 - 2012None 7autom. Kantenfinder Bitmaps\hintergrund_codefenster.bmp@Screen fr automatischen Kantenfinder nach C. Selig by W. Kenter%+.4fU"NoneSetIJMode(0) &autom. Kantenfinder Bitmaps\ij_abs.bmpNone%+.4f "NoneSetIJMode(1) &autom. Kantenfinder Bitmaps\ij_ink.bmpLabel%+.4f) NonerIf GetUserLED(1233) = 1 Then Code "m5" SetUserLED(1233,0) Else Code "m3" SetUserLED(1233,1) End If 'autom. Kantenfinder Bitmaps\ein_aus.bmpNonen%+.4f=NoneNone None%+.4f^N2NoneNone -autom. Kantenfinder Bitmaps\Bildschirm_50.bmpNone%+.4f 2NoneNone None;%+.4f2NoneNone None%+.4fLo2NoneNone None%+.4f[K~n2NoneNone None%+.4f1KTn2NoneNone None%+.4fK*n 2NoneNone None4%+.4f{) 2NoneNone None7%+.4fZ}? 2NoneNone None:%+.4fy 2NoneNone None9%+.4f? 2NoneNone None8%+.4f[z~ 2NoneNone None3%+.4f*? 2NoneNone None5%+.4f1T?82NoneNone NoneNone%+.4fP_Xx82NoneNone NoneNone%+.4fP{X82NoneNone NoneNone%+.4fPX82NoneNone NoneNone%+.4fPX82NoneNone NoneNone%+.4f*C82NoneNone NoneNone%+.4f'82NoneNone NoneNone>%+.4f82NoneNone NoneNone=%+.4f82NoneNone NoneNone<%+.4f=E82NoneNone NoneNonex%+.4f82NoneNone NoneNonev%+.4fk82NoneNone NoneNone;%+.4f=E 2NoneNone Nonez%+.4fm 2NoneNone Noney%+.4f: 2NoneNone Nonex%+.4f:"2NonexDoOEMButton 327 DoOEMButton 304 SetUserLED(1001, 1) If GetOEMLED (83) = 0 Then DoOEMButton (103) End If NoneK%+.4fl"2NonexDoOEMButton 327 DoOEMButton 306 SetUserLED(1001, 1) If GetOEMLED (83) = 0 Then DoOEMButton (103) End If NoneS%+.4f 2NoneNone None%+.4fm"2NonexDoOEMButton 275 DoOEMButton 305 SetUserLED(1001, 0) If GetOEMLED (83) = 0 Then DoOEMButton (103) End If NoneE%+.4f)B"2NonexDoOEMButton 276 DoOEMButton 305 SetUserLED(1001, 0) If GetOEMLED (83) = 0 Then DoOEMButton (103) End If NoneG%+.4f ("2NonebDoOEMButton(191) SetUserLED(1201,0) SetUserLED(1202,0) SetUserLED(1203,0) SetUserLED(1204,1) None1%+.4f`Ny"2NonebDoOEMButton(192) SetUserLED(1201,0) SetUserLED(1202,0) SetUserLED(1203,1) SetUserLED(1204,0) None2%+.4fzM"2NonebDoOEMButton(193) SetUserLED(1201,0) SetUserLED(1202,1) SetUserLED(1203,0) SetUserLED(1204,0) None3%+.4fN"2NonebDoOEMButton(194) SetUserLED(1201,1) SetUserLED(1202,0) SetUserLED(1203,0) SetUserLED(1204,0) None4%+.4fN 2NoneNone &autom. Kantenfinder Bitmaps\slider.bmpSkinnedbSTDL10H100%3.0f 2NoneNone NoneoQ%+.4f` 2NoneNone NonepW%+.4f 2NoneNone NoneNone3'%+.4f\_ 2NoneNone NoneNone4%%+.4f\_ 2NoneNone NoneNone5&%+.4f\_ 2NoneNone NoneNone6(%+.4fsv 2NoneNone NoneNone7!%+.4fsv 2NoneNone NoneNone8"%+.4fqt 2NoneNone NoneNone8"%+.4fqt 2NoneNone NoneNone7!%+.4fem 2NoneNone NoneNone6(%+.4fsv 2NoneNone NoneNone5&%+.4feh 2NoneNone NoneNone4%%+.4feh 2NoneNone NoneNone3'%+.4fbj"2NonebCode "G92.2" Call SetDRO(0, ABS(GetOEMDRO(1000))/-(2)-GetOEMDRO(1209)) Call SetUserLED(1201,0) NoneNoneX%+.4f\ddl"2NonebCode "G92.2" Call SetDRO(1, ABS(GetOEMDRO(1000))/-(2)-GetOEMDRO(1209)) Call SetUserLED(1201,0) NoneYL%+.4f\sd{"2NoneCode "G92.2" Gage_Block = GetOEMDRO(1201) if Gage_Block > 0 then Message "Achtung: Distanzstck ist gesetzt" PlayWave "C:\Mach3\Bitmaps\SeligBitmaps\Hinweis.wav" end if New_Pos = Gage_Block Call SetDRO(2, New_Pos) NoneZ%+.4f\d2NoneNone Nonev Gag%+.4f\d2NoneNone Nonew Gag%+.4fodwl"2None\if GetDRO (24) <>0 then SetUserDRO(1216,GetOEMDRO(83)) SetUserDRO(1217,GetOEMDRO(84)) Code "G0G53 Z" & GetOEMDRO(54) While IsMoving() Wend code "g0 g53 x" & GetOEMDRO(1218) While IsMoving() Wend code "g0 g53 y" & GetOEMDRO(1219) While IsMoving() Wend code "g0 g53 z" & GetOEMDRO(1220) While IsMoving() Wend code "g31 z-1000 f500" While IsMoving() Wend code "g53 g0 z" & GetOEMDRO(85)+3 While IsMoving() Wend code "g31 z-1000 f50" While IsMoving() Wend Z_Shift = GetOEMDRO (1221) Axis_Pos = GetOEMDRO(85) Tool_Offset = Axis_Pos - Z_Shift Call setOEMDRO(42, Tool_Offset) Code "G0G53 Z" & GetOEMDRO(54) Code "G0G53 X" & GetOEMDRO(1216) Code "G0G53 Y" & GetOEMDRO(1217) else MsgBox "Keine Werkzeug-Nummer gewhlt",0 end if NoneNoneV%+.4fosw{"2NoneXpos = GetOEMDRO(1202) Ypos = GetOEMDRO(1203) SetOEMDRO(1216,GetOEMDRO(800)) SetOEMDRO(1217,GetOEMDRO(801)) Code "G0G53Z" & GetOEMDRO(54) Code "G0G53X" & XPos Code "G0G53Y" & YPos NoneLabel0 %+.4fmu 2NoneNone NoneNone~%+.0fX8NoneNone NoneNone %+.4fAP8NoneNone NoneNone %+.4fAP8NoneNone NoneNone %+.4fAP NoneNone NoneLabelt%+.4fN82NoneNone NoneNoneS%+.4fNPOQNoneNone +autom. Kantenfinder Bitmaps\Bildschirm5.bmpLabel%+.4fL NoneNone NoneLabelqF%+.4fC8NoneNone NoneLabel %+.4f3D"NoneNCode "G92.2" Call SetOEMDRO(800, ABS(GetOEMDRO(1000))/-(2)-GetOEMDRO(1209)) NoneLabelXe%+.4f<Jr"NoneNCode "G92.2" Call SetOEMDRO(801, ABS(GetOEMDRO(1000))/-(2)-GetOEMDRO(1209)) NoneLabelYe%+.4fKfsNoneNone None%%+.4f}NoneNone None%%+.4f0INoneNone None%%+.4f NoneNone NoneLabelJx%.0fNoneNone NoneLabelx%.0f0 NoneNone NoneLabele%.0f NoneNone NoneLabel~e%.0f;NoneNone NoneLabelv%+.4f None NoneLabelw%+.4f7"NonebDoOEMButton(193) SetUserLED(1201,0) SetUserLED(1202,1) SetUserLED(1203,0) SetUserLED(1204,0) NoneNonec%+.4fp"NonebDoOEMButton(192) SetUserLED(1201,0) SetUserLED(1202,0) SetUserLED(1203,1) SetUserLED(1204,0) NoneNoneb%+.4fny"NonebDoOEMButton(191) SetUserLED(1201,0) SetUserLED(1202,0) SetUserLED(1203,0) SetUserLED(1204,1) NoneNonea%+.4fnKs NoneNone NoneNoney%+.4fnE NoneNone NoneNonex%+.4fo NoneNone NoneNonepW%+.4f- NoneNone NoneNoneoQ%+.4f-Jr NoneNone NoneNonez%+.4f|"None"DoOEMButton 327 DoOEMButton 306 NoneS%+.4fn|"None"DoOEMButton 327 DoOEMButton 304 NoneK%+.4fp~"None"DoOEMButton 275 DoOEMButton 305 NoneNoneE%+.4fo.}V"None"DoOEMButton 276 DoOEMButton 305 NoneNoneG%+.4fq' NoneNone Nonem%+.4f<JB NoneNone NoneNonel%+.4f;I"None%SetUserDRO(1215,5) DoOEMButton(11) NoneNone%+.4f<iJ"NonebCode "G0G53 Z" & GetOEMDRO(54) Code "G0G53X" & GetOEMDRO(1216) Code "G0G53Y" & GetOEMDRO(1217) NoneNoneR%+.4f=;Kc"NoneCode "G92.2" Gage_Block = GetOEMDRO(1002) if Gage_Block > 0 then Message "Achtung: Distanzstck ist gesetzt" PlayWave "C:\Mach3\Bitmaps\SeligBitmaps\Hinweis.wav" end if New_Pos = Gage_Block Call SetOEMDRO(802, New_Pos) NoneNoneZ%+.4f<J:"None Code "G0G53 Z" & GetOEMDRO(54) NoneNoneB%+.4f;I "None>SetOEMDRO(1216,GetOEMDRO(83)) SetOEMDRO(1217,GetOEMDRO(84)) NoneNoneO%+.4f=K NoneNone NoneNoneP%+.4f NonejIf GetUserLED(1233) = 1 Then code "m5" SetUserLED(1233,0) Else code "m3" SetUserLED(1233,1) End If Nonen{%+.4fh NoneNone NoneNoneM%+.4f NoneNone NoneNone%.0f.y~8NoneNone NoneNone%+.4fK%s8NoneNone NoneNone%+.4fx%8NoneNone NoneNone%+.4f%8NoneNone NoneNone=%+.4f8NoneNone NoneNone<%+.4fC8NoneNone NoneNone;%+.4f8NoneNone NoneNone %+.4fh38NoneNone NoneNone$%+.4f3 8NoneNone NoneNonex%+.4f8NoneNone NoneNonev%+.4f8NoneNone NoneNone%+.4f.V8NoneNone NoneNone%+.4f'8NoneNone NoneNone&%+.4f*#fANoneNone NoneNone%+.3f*!3MNoneNone NoneNone%+.3f*S3NoneNone NoneNone%+.3f*3NoneNone +autom. Kantenfinder Bitmaps\Bildschirm1.bmpLabel%+.4fK NonejIf GetUserLED(1233) = 1 Then code "m5" SetUserLED(1233,0) Else code "m3" SetUserLED(1233,1) End If Nonen{%+.4f[d|NoneNone 7autom. Kantenfinder Bitmaps\hintergrund_codefenster.bmpNone%+.4f?CZeile:None NoneZeile:%+.4f#5 NoneNone None%+.4f"NoneXpos = GetOEMDRO(1205) Ypos = GetOEMDRO(1206) Zpos = GetOEMDRO(1207) Code "G0G53 Z" & GetOEMDRO(54) Code "G0G53X" & XPos Code "G0G53Y" & Ypos Code "G0G53Z" & ZPos None %+.4f\u"None>SetOEMDRO(1216,GetOEMDRO(83)) SetOEMDRO(1217,GetOEMDRO(84)) NoneO%+.4f NoneNone Nonew%+.4f"None@Code "G0G53Z" & GetOEMDRO(54) Code "G0 X0 Y0" Code "G0 Z0" None%+.4f|8NoneNone NoneNone %+.4fd| NoneNone None%+.4f[NoneNone None%+.4fd| RckmeldungNone None Rckmeldung%+.4fb!ist:None Noneist:%+.4f\xsoll:None Nonesoll:%+.4f\} NoneNone NoneNone'%.0f_'@ NoneNone NoneNone%.0f NoneNone NoneNone1%.0f8NoneNone NoneNone%+.4fd|8NoneNone NoneNone"%+.4f Zoll/min.None None Zoll/min.%+.4f8NoneNone NoneNone!%+.4fsoll:None Nonesoll:%+.4fist:None Noneist:%+.4fmm/min.None Nonemm/min.%+.4f NoneNone NoneNone7%.0fNoneNone NoneNone%.0f NoneNone &autom. Kantenfinder Bitmaps\slider.bmpSkinnedJbSTDL10H310%3.0f! NoneNone NoneP%+.4fd NoneNone NoneM%+.4f"D NoneNone Nonem%+.4f&"HD NoneNone Nonel%+.4f&dHNoneNone &autom. Kantenfinder Bitmaps\slider.bmpSkinnedbSTDL10H310%3.0f&H!"NoneCode "G92.2" Gage_Block = GetOEMDRO(1201) if Gage_Block > 0 then Message "Achtung: Distanzstck ist gesetzt" PlayWave "C:\Mach3\Bitmaps\SeligBitmaps\Hinweis.wav" end if New_Pos = Gage_Block Call SetOEMDRO(802, New_Pos) NoneZ%+.4f"None$SetOEMDRO(1215,1) DoOEMButton(11) NoneV%+.4f)B8NoneNone NoneNone&%+.4fjWechselnNone NoneWechseln%+.4f XNoneNone NoneNone%+.2fj DurchmesserNone None Durchmesser%+.4f lNummerNone NoneNummer%+.4f gOyNoneNone NoneNone%.0fjg{ NoneNone None%+.4f868NoneNone NoneNone/%+.4f>F6"None#SetOEMDRO(1210,1) DoOEMButton(7) None%+.4fY6 NoneNone None%+.4f68NoneNone NoneNone%+.4f*E NoneNone None%+.4f8NoneNone NoneNone%+.4f KorrekturNone None Korrektur%+.4fRad.None NoneRad.%+.4f NoneNone None%+.4f NoneNone None%+.4fi8NoneNone NoneNone*%+.4f8NoneNone NoneNone)%+.4f8NoneNone NoneNone(%+.4fi8NoneNone NoneNone'%+.4f@cNoneNone None%+.4f@cSkal.None NoneSkal.%+.4f NoneNone NoneNone=%+.2f8NoneNone NoneNone+%+.4fSkal.None NoneSkal.%+.4fjy NoneNone NoneNone<%+.2f|8NoneNone NoneNone*%+.4fjz8NoneNone NoneNone)%+.4f?O NoneNone NoneNone;%+.2fScSkal.None NoneSkal.%+.4f@ONoneNone None%+.4fNoneNone None%+.4fNoneNone None%+.4fiNoneNone None%+.4f@cNoneNone NoneNone%+.3fNoneNone NoneNone%+.3fNoneNone NoneNone%+.3fiNoneNone NoneNone%+.3f@c8NoneNone NoneNone%+.4f NoneNone None%+.4f" 4 NoneNone Nones%+.4f <NoneNone NoneNone%.0f"7NoneNone NoneNone%.2f"q7 NoneNone None%+.4f <NoneNone None%+.4fNone Nonew%+.4f NoneNone None%+.4fNoneNone None%+.4fNoneNone None%+.4fb{None Nonev%+.4fD]8NoneNone NoneNoneR%+.4f NoneNone NoneNone %+.4f@ NoneNone None%+.4f <"Nonex = GetOEMDRO (800) y = GetOEMDRO (801) z = GetOEMDRO (802) SetOEMDRO (1211, x) SetOEMDRO (1212, y) SetOEMDRO (1213, z) ' remember the coords of curso Call SetUserLED (1050,1) Call SetUserLED (1051,0) None%+.4f %"NoneKxdash = GetOEMDRO (83) ydash = GetOEMDRO (84) zdash = GetOEMDRO (85) ' get X , Y and Z of tool now x = GetOEMDRO (1211) y = GetOEMDRO (1212) z = GetOEMDRO (1213) SetOEMDRO (47, xdash - x) SetOEMDRO (48, ydash - y) SetOEMDRO (49, zdash) Call SetUserLED (1051,1) Call SetUserLED (1050,0) rem DoOEMButton (160) None%+.4f)B8NoneNone NoneNone%+.4f ' NoneNone NoneNone%+.3fY NoneNone NoneNone %+.3f X vonNone None X von%+.4f bisNone None bis%+.4fa bisNone None bis%+.4fa* Y vonNone None Y von%+.4f* NoneNone NoneNone %+.3f, NoneNone NoneNone%+.3fY, bisNone None bis%+.4fa0B Z vonNone None Z von%+.4f0B NoneNone NoneNone %+.3f0D NoneNone NoneNone%+.3f0YD!Koordinaten-Grenzen des ProgrammsNone None!Koordinaten-Grenzen des Programms%+.4f NoneNone NoneNone%+.4f"NonebCode "G0G53 Z" & GetOEMDRO(54) Code "G0G53X" & GetOEMDRO(1216) Code "G0G53Y" & GetOEMDRO(1217) NoneRq%+.4f %"None Code "G0G53 Z" & GetOEMDRO(54) NoneBge_B%+.4f8NoneNone NoneNone-%+.4f8NoneNone NoneNone/%+.4f8NoneNone NoneNoneC%+.4fNoneNone +autom. Kantenfinder Bitmaps\Bildschirm8.bmpLabel%+.4fLNoneNone NoneZ:%+.4f&0=DNoneNone NoneLabelCode%+.3fB-FNoneNone Label%+.4f-SF"None4DoOEMButton 1001 DoOEMButton 276 DoOEMButton 305 NoneLabele mo%+.4f`-F8NoneNone NoneLabel/%+.4f>-FF NoneNone NoneLabel%+.4f-F NoneNone Label%+.4f-9F"NoneDoOEMButton(GetOEMDRO(1210)) Label%+.4f_-F NoneNone NoneNone%+.4f * NoneNone -autom. Kantenfinder Bitmaps\Bildschirm11a.bmpLabel%+.4fL NoneNone NoneMaschinenkoordinaten%+.4f} NoneNone NoneMaschinenkoordinatenH%+.4fp NoneNone NoneZ:%+.4f NoneNone NoneY:%+.4f NoneNone NoneX:%+.4f}  NoneNone NoneLabelS%+.3f|  NoneNone NoneLabelT%+.3f  NoneNone NoneLabelUA%+.3f" None>SetOEMDRO(1218,GetOEMDRO(83)) SetOEMDRO(1219,GetOEMDRO(84)) NoneLabel Gag%+.4f8V NoneNone NoneSensorposition in Gag%+.4f} Sensor YNone NoneY%+.4f7 Sensor XNone NoneX%+.4f  NoneNone NoneNoneq%+.3f3  NoneNone NoneNoneq%+.3f" NoneIf GetOEMDRO (824) <>0 Then SetOEMDRO(1216,GetOEMDRO(83)) SetOEMDRO(1217,GetOEMDRO(84)) Code "G0G53 Z" & GetOEMDRO(54) While IsMoving() Wend code "g0 g53 x" & GetOEMDRO(1218) While IsMoving() Wend code "g0 g53 y" & GetOEMDRO(1219) While IsMoving() Wend code "g0 g53 z" & GetOEMDRO(1220) While IsMoving() Wend code "g31 z-1000 f500" While IsMoving() Wend code "g53 g0 z" & GetOEMDRO(85)+3 While IsMoving() Wend code "g31 z-1000 f50" While IsMoving() Wend Z_Shift = GetOEMDRO (1221) Axis_Pos = GetOEMDRO(85) Tool_Offset = Axis_Pos - Z_Shift Call setOEMDRO(42, Tool_Offset) Code "G0G53 Z" & GetOEMDRO(54) Code "G0G53 X" & GetOEMDRO(1216) Code "G0G53 Y" & GetOEMDRO(1217) MsgBox "Ihr Frsprogramm muss die Befehhlszeile G43 H" & GetOEMDRO (824) _ & " M6 T" & GetOEMDRO (824) _ & " fr den Werkzeugwechsel enthalten" Else MsgBox "Keine Werkzeug-Nummer gewhlt",0 End If NoneV%+.4f NoneNone NoneNone%.0fSMf NummerNone NoneNummer%+.4fPKb DurchmesserNone None Durchmesser%+.4fnK NoneNone NoneNone%.2fKn" None Code "G0G53 Z" & GetOEMDRO(54) NoneB%+.4f" NoneDoOEMButton(GetOEMDRO(1215)) NoneUq%+.4f%@  NoneNone NoneNone%.2f  NoneNone NoneNone%+.3ffRp Vorschub imNone None Vorschub im%+.4fOa Eilgang bis -ZNone NoneEilgang bis -Z%+.4fals Schalter HheNone None Schalter Hhe%+.4fk NoneNone ,autom. Kantenfinder Bitmaps\Bildschirm13.bmpLabel%+.4fL" None6Code "G90" Code "G00 Z" & CStr(GetOEMDRO(1012)) NoneNoneD%+.4f  NoneNone NoneNone%+.3fJ  NoneNone Nonen%+.4f !U:8 NoneNone NoneNoneJ%+.4f-'5@ NoneNone NoneLabel%+.4f}&B8 NoneNone NoneLabel%+.4f[k8 NoneNone NoneNone %+.4fW_8 NoneNone NoneNone %+.4fW_8 NoneNone NoneNone %+.4fW!_:8 NoneNone NoneNone%+.4fWE_^8 NoneNone NoneNone%+.4f8 NoneNone NoneNone%+.4f8 NoneNone NoneNone%+.4f8 NoneNone NoneNone%+.4f8 NoneNone NoneNone%+.4fz8 NoneNone NoneNone%+.4f^w8 NoneNone NoneNone%+.4fB[  NoneNone &autom. Kantenfinder Bitmaps\slider.bmpSkinnedSTDL10H100%3.0f  NoneNone &autom. Kantenfinder Bitmaps\slider.bmpSkinnedJSTDL10H310%3.0fA NoneNone &autom. Kantenfinder Bitmaps\slider.bmpSkinnedSTDL10H310%3.0fe  NoneNone NoneLabel%+.4ff  NoneNone NoneLabel%+.4fCa NoneNone NoneLabel%+.4f > NoneNone NoneLabel%+.4ff NoneNone NoneLabel%+.4fCa NoneNone NoneLabel%+.4f >  NoneNone NoneLabelp%+.4f;  NoneNone NoneNonegq<%.0f5jv  None NoneLabelr%+.4f U  None NoneLabelq%+.4f U  None NoneLabel%+.4f ?UX None NoneLabel%+.4f EU^" NonerDoOEMButton 275 DoOEMButton 305 SetUserLED(1001, 0) If GetOEMLED (83) = 0 Then DoOEMButton (103) End If NoneLabelD%+.4fQ^w" NonelDoOEMButton 276 DoOEMButton 305 SetUserLED(1001, 0) If GetOEMLED (83) = 0 Then DoOEMButton (103) End If NoneLabelD%+.4fQB[" NoneTIf GetUserLED(1002) = 0 Then SetUserLED(1002, 1) Else SetUserLED(1002, 0) end if NoneLabelD%+.4fX" None"DoOEMButton(228) DoOEMButton(1) NoneNoneD%+.4f%C" NoneCloseTeachFile NoneNoneD%+.4f;%C" None#OpenTeachFile "Lernprogramm.tap" NoneNoneD%+.4f%*C" NoneIf GetOEMDRO(1128) <= 0 Then MsgBox "Z-Vorschub zu gering" Exit Sub End If SetOEMDRO(818, GetOEMDRO(1128)) Code "G91" Code "G01 Z" & CStr(GetOEMDRO(1010)* -1) & "F" & CStr(GetOEMDRO(1128)) Code "G90" NoneLabelD%+.4f" NoneIf GetUserLED(1003) = 1 Then If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen Y- / Y+ falsch gesetzt" Exit Sub End If Code "G90" If GetUserLED(1002) = 1 Then SetOEMDRO(1011, GetOEMDRO(802)) Code "G00 Z" & CStr(GetOEMDRO(1009)) Code "G00 Y" & CStr(GetOEMDRO(1005)) Code "G00 Z" & CStr(GetOEMDRO(1011)) Else Code "G00 Y" & CStr(GetOEMDRO(1005)) End If Else If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen 4- / 4+ falsch gesetzt" Exit Sub End If Code "G90" If GetUserLED(1002) = 1 Then SetOEMDRO(1011, GetOEMDRO(802)) Code "G00 Z" & CStr(GetOEMDRO(1009)) Code "G00 A" & CStr(GetOEMDRO(1005)) Code "G00 Z" & CStr(GetOEMDRO(1011)) Else Code "G00 A" & CStr(GetOEMDRO(1005)) End If End If NoneLabelD%+.4f"|" NoneIf GetUserLED(1003) = 1 Then If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen Y- / Y+ falsch gesetzt" Exit Sub End If If GetOEMDRO(801) < GetOEMDRO(1005) Then MsgBox "Grenze Y- unterschritten" Exit Sub End If SetOEMDRO(818, GetOEMDRO(1127)) If (GetOEMDRO(801) - GetOEMDRO(1006)) < GetOEMDRO(1005) Then Code "G90" Code "G01 Y" & CStr(GetOEMDRO(1005)) Else Code "G91" Code "G01 Y" & CStr(GetOEMDRO(1006)* -1) Code "G90" End If Else If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen 4- / 4+ falsch gesetzt" Exit Sub End If If GetOEMDRO(801) < GetOEMDRO(1005) Then MsgBox "Grenze 4- unterschritten" Exit Sub End If SetOEMDRO(818, GetOEMDRO(1127)) If (GetOEMDRO(801) - GetOEMDRO(1006)) < GetOEMDRO(1005) Then Code "G90" Code "G01 A" & CStr(GetOEMDRO(1005)) Else Code "G91" Code "G01 A" & CStr(GetOEMDRO(1006)* -1) Code "G90" End If End If NoneLabelD%+.4f" NoneaIf GetUserLED(1003) = 1 Then If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen Y- / Y+ falsch gesetzt" Exit Sub End If If GetOEMDRO(801) < GetOEMDRO(1005) Then MsgBox "Grenze Y- unterschritten" Exit Sub End If Else If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen 4- / 4+ falsch gesetzt" Exit Sub End If If GetOEMDRO(801) < GetOEMDRO(1005) Then MsgBox "Grenze 4- unterschritten" Exit Sub End If End If SetOEMDRO(818, GetOEMDRO(1127)) Code "G90" If GetUserLED(1003) = 1 Then Code "G01 Y" & CStr(GetOEMDRO(1005)) Else Code "G01 A" & CStr(GetOEMDRO(1005)) End If NoneLabelD%+.4fh" NoneTIf GetOEMDRO(1001) > GetOEMDRO(1003) Then MsgBox "Grenzen X- / X+ falsch gesetzt" Exit Sub End If Code "G90" If GetUserLED(1002) = 1 Then SetOEMDRO(1011, GetOEMDRO(802)) Code "G00 Z" & CStr(GetOEMDRO(1009)) Code "G00 X" & CStr(GetOEMDRO(1003)) Code "G00 Z" & CStr(GetOEMDRO(1011)) Else Code "G00 X" & CStr(GetOEMDRO(1003)) End If NoneLabelD%+.4fWbp" NoneIf GetOEMDRO(1001) > GetOEMDRO(1003) Then MsgBox "Grenzen X- / X+ falsch gesetzt" Exit Sub End If If GetOEMDRO(800) > GetOEMDRO(1003) Then MsgBox "Grenze X+ berschritten" Exit Sub End If SetOEMDRO(818, GetOEMDRO(1127)) If (GetOEMDRO(800) + GetOEMDRO(1004)) > GetOEMDRO(1003) Then Code "G90" Code "G01 X" & CStr(GetOEMDRO(1003)) Else Code "G91" Code "G01 X" & CStr(GetOEMDRO(1004)) Code "G90" End If NoneLabelD%+.4f;bT" NoneIf GetOEMDRO(1001) > GetOEMDRO(1003) Then MsgBox "Grenzen X- / X+ falsch gesetzt" Exit Sub End If If GetOEMDRO(800) > GetOEMDRO(1003) Then MsgBox "Grenze X+ berschritten" Exit Sub End If SetOEMDRO(818, GetOEMDRO(1127)) Code "G90" Code "G01 X" & CStr(GetOEMDRO(1003)) NoneLabelD%+.4fb8" NoneVIf GetOEMDRO(1001) > GetOEMDRO(1003) Then MsgBox "Grenzen X- / X+ falsch gesetzt" Exit Sub End If Code "G90" If GetUserLED(1002) = 1 Then SetOEMDRO(1011, GetOEMDRO(802)) Code "G00 Z" & CStr(GetOEMDRO(1009)) Code "G00 X" & CStr(GetOEMDRO(1001)) Code "G00 Z" & CStr(GetOEMDRO(1011)) Else Code "G00 X" & CStr(GetOEMDRO(1001)) End If NoneLabelD%+.4fWp" NoneIf GetOEMDRO(1001) > GetOEMDRO(1003) Then MsgBox "Grenzen X- / X+ falsch gesetzt" Exit Sub End If If GetOEMDRO(800) < GetOEMDRO(1001) Then MsgBox "Grenze X- unterschritten" Exit Sub End If SetOEMDRO(818, GetOEMDRO(1127)) If (GetOEMDRO(800) - GetOEMDRO(1002)) < GetOEMDRO(1001) Then Code "G90" Code "G01 X" & CStr(GetOEMDRO(1001)) Else Code "G91" Code "G01 X" & CStr(GetOEMDRO(1002)* -1) Code "G90" End If NoneLabelD%+.4f;T" NoneIf GetOEMDRO(1001) > GetOEMDRO(1003) Then MsgBox "Grenzen X- / X+ falsch gesetzt" Exit Sub End If If GetOEMDRO(800) < GetOEMDRO(1001) Then MsgBox "Grenze X- unterschritten" Exit Sub End If SetOEMDRO(818, GetOEMDRO(1127)) Code "G90" Code "G01 X" & CStr(GetOEMDRO(1001)) NoneLabelD%+.4f8" NoneIf GetUserLED(1003) = 1 Then If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen Y- / Y+ falsch gesetzt" Exit Sub End If Code "G90" If GetUserLED(1002) = 1 Then SetOEMDRO(1011, GetOEMDRO(802)) Code "G00 Z" & CStr(GetOEMDRO(1009)) Code "G00 Y" & CStr(GetOEMDRO(1007)) Code "G00 Z" & CStr(GetOEMDRO(1011)) Else Code "G00 Y" & CStr(GetOEMDRO(1007)) End If Else If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen 4- / 4+ falsch gesetzt" Exit Sub End If Code "G90" If GetUserLED(1002) = 1 Then SetOEMDRO(1011, GetOEMDRO(802)) Code "G00 Z" & CStr(GetOEMDRO(1009)) Code "G00 A" & CStr(GetOEMDRO(1007)) Code "G00 Z" & CStr(GetOEMDRO(1011)) Else Code "G00 A" & CStr(GetOEMDRO(1007)) End If End If NoneLabelD%+.4f"|" NoneIf GetUserLED(1003) = 1 Then If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen Y- / Y+ falsch gesetzt" Exit Sub End If If GetOEMDRO(801) > GetOEMDRO(1007) Then MsgBox "Grenze Y+ berschritten" Exit Sub End If SetOEMDRO(818, GetOEMDRO(1127)) If (GetOEMDRO(801) + GetOEMDRO(1008)) > GetOEMDRO(1007) Then Code "G90" Code "G01 Y" & CStr(GetOEMDRO(1007)) Else Code "G91" Code "G01 Y" & CStr(GetOEMDRO(1008)) Code "G90" End If Else If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen 4- / 4+ falsch gesetzt" Exit Sub End If If GetOEMDRO(801) > GetOEMDRO(1007) Then MsgBox "Grenze 4+ berschritten" Exit Sub End If SetOEMDRO(818, GetOEMDRO(1127)) If (GetOEMDRO(801) + GetOEMDRO(1008)) > GetOEMDRO(1007) Then Code "G90" Code "G01 A" & CStr(GetOEMDRO(1007)) Else Code "G91" Code "G01 A" & CStr(GetOEMDRO(1008)) Code "G90" End If End If NoneLabelD%+.4f" None_If GetUserLED(1003) = 1 Then If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen Y- / Y+ falsch gesetzt" Exit Sub End If If GetOEMDRO(801) > GetOEMDRO(1007) Then MsgBox "Grenze Y+ berschritten" Exit Sub End If Else If GetOEMDRO(1005) > GetOEMDRO(1007) Then MsgBox "Grenzen 4- / 4+ falsch gesetzt" Exit Sub End If If GetOEMDRO(801) > GetOEMDRO(1007) Then MsgBox "Grenze 4+ berschritten" Exit Sub End If End If SetOEMDRO(818, GetOEMDRO(1127)) Code "G90" If GetUserLED(1003) = 1 Then Code "G01 Y" & CStr(GetOEMDRO(1007)) Else Code "G01 A" & CStr(GetOEMDRO(1007)) End If NoneLabelD%+.4fh  NoneNone NoneNone%0.3f}  NoneNone NoneNone%.0fo  NoneNone NoneLabel%.3f,  NoneNone NoneLabel%+.3f,  NoneNone NoneLabel%.3fjJc  NoneNone NoneLabel%+.3fj,E  NoneNone NoneLabel%.3f J|c  NoneNone NoneLabel%+.3f ,|E  NoneNone NoneLabel%.3f-  NoneNone NoneLabel%+.3f- NoneNone NoneLabel%+.3ff{ NoneNone NoneLabel%+.3fC{a NoneNone NoneLabel%+.3f {>  NoneNone NoneLabel~q<%.0fQ";  NoneNone NoneLabelq<%.0f5}v  NoneNone NoneLabel1q<%.0f5_vx  NoneNone NoneLabel7q<%.0f5v  NoneNone NoneNonehq<%.0f5v" NonebDoOEMButton(191) SetUserLED(1201,0) SetUserLED(1202,0) SetUserLED(1203,0) SetUserLED(1204,1) NoneLabel%+.4fQ" NonebDoOEMButton(192) SetUserLED(1201,0) SetUserLED(1202,0) SetUserLED(1203,1) SetUserLED(1204,0) NoneLabel%+.4fQ" NonebDoOEMButton(193) SetUserLED(1201,0) SetUserLED(1202,1) SetUserLED(1203,0) SetUserLED(1204,0) NoneLabel%+.4fQ" NonebDoOEMButton(194) SetUserLED(1201,1) SetUserLED(1202,0) SetUserLED(1203,0) SetUserLED(1204,0) NoneLabel%+.4fQ  NoneNone NoneLabelo%+.4f  NoneNone NoneLabell%+.4fEc  NoneNone NoneLabelm%+.4f  NoneNone NoneLabel%+.4f!?  NoneNone NoneLabel%+.4f  NoneNone NoneLabel%+.4fQq  NoneNone NoneLabel%+.4fQ  NoneNone NoneLabel%+.4fR  NoneNone NoneLabel%+.4fR  NoneNone NoneLabel%+.4fR  NoneNone NoneLabel%+.4fQNoneNone ,autom. Kantenfinder Bitmaps\Bildschirm14.bmpLabel%+.4fL"NoneH Sub Main() DoOEMBUTTON (169) G73 = GetUserLED(1233) G81 = GetUserLED(1234) G82 = GetUserLED(1235) G83 = GetUserLED(1236) G85 = GetUserLED(1237) G86 = GetUserLED(1238) G89 = GetUserLED(1240) Man = GetUserLED(1239) Bohrtiefe = GetOEMDRO(1121) Zustelltiefe = GetOEMDRO(1122) Rueckzugebene = GetOEMDRO(1123) Rueckzug_um = GetOEMDRO(1124) Verweilzeit = GetOEMDRO(1125) Materialhoehe = GetOEMDRO(1126) Vorschub_Z = GetOEMDRO(1128) Xerste = GetOEMDRO(1134) Yerste = GetOEMDRO(1135) Xletzte = GetOEMDRO(1136) Yletzte = GetOEMDRO(1137) Anzahl = GetOEMDRO(1138) If Anzahl = 0 Then MsgBox "Anzahl kann nicht Null sein" Exit Sub End If XSchritt = (Xletzte - Xerste) / Anzahl YSchritt = (Yletzte - Yerste) / Anzahl XPos = Xerste YPos = Yerste If Bohrtiefe = 0 Then MsgBox "Bohrtiefe kann nicht Null sein" Exit Sub End If If (G73 = 1 Or G83 = 1) And Zustelltiefe = 0 Then MsgBox "Zustelltiefe kann nicht Null sein" Exit Sub End If If Vorschub_Z <= 0 Then MsgBox "Vorschub Z zu klein" Exit Sub End If If GetOEMDRO(1120) < 100 Then MsgBox "Spindeldrehzahl zu gering" Exit Sub End If OpenTeachFile "Bohrzyklen.tap" Code "(Bohrungen in Reihe)" Code "G0 G40 G17 G80 G50 G90 G21 " Code "G0" + " Z" + CStr(Rueckzugebene) Code "M3 S" + CStr(GetOEMDRO(1120)) If GetUserLED(1128) Then 'Khlung Nebel Code"M07" End If If GetUserLED(1127) Then 'Khlung Schwall Code"M08" End If For i = 1 To Anzahl +1 Kommando = " X" & CStr(XPos, 4) & " Y" + CStr(YPos, 4) If G73 = 1 Then Kommando = "G73" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " Q" + CStr(Zustelltiefe) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G81 = 1 Then Kommando = "G81" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G82 = 1 Then Kommando = "G82" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " P" + CStr(Verweilzeit) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G83 = 1 Then Kommando = "G83" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " Q" + CStr(Zustelltiefe) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G85 = 1 Then Kommando = "G85" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G86 = 1 Then Kommando = "G86" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " P" + CStr(Verweilzeit) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G89 = 1 Then Kommando = "G89" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " P" + CStr(Verweilzeit) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If Man = 1 Then Code Kommando Kommando = "M0" End If Code Kommando XPos = XPos + XSchritt YPos = YPos + YSchritt Next i Code "G80" Code"M5 M9" Code "M30" CloseTeachFile Call LoadTeachFile() DoOEMBUTTON(1) End Sub None%+.4f"NonepSub Main() DoOEMButton (169) Mittelpunkt_X = GetOEMDRO (1129) Mittelpunkt_Y = GetOEMDRO (1130) Anzahl_Bohrungen = GetOEMDRO (1133) Durchmesser = GetOEMDRO (1131) Startwinkel = GetOEMDRO (1132) G73 = GetUserLED(1233) G81 = GetUserLED(1234) G82 = GetUserLED(1235) G83 = GetUserLED(1236) G85 = GetUserLED(1237) G86 = GetUserLED(1238) G89 = GetUserLED(1240) Bohrtiefe = GetOEMDRO(1121) Zustelltiefe = GetOEMDRO(1122) Rueckzugebene = GetOEMDRO(1123) Rueckzug_um = GetOEMDRO(1124) Verweilzeit = GetOEMDRO(1125) Materialhoehe = GetOEMDRO(1126) Vorschub_Z = GetOEMDRO(1128) A_Achse = 0 If Bohrtiefe = 0 Then MsgBox "Bohrtiefe kann nicht Null sein" Exit Sub End If If Vorschub_Z <= 0 Then MsgBox "Vorschub Z zu klein" Exit Sub End If If GetOEMDRO(1120) < 100 Then MsgBox "Spindeldrehzahl zu gering" Exit Sub End If If Anzahl_Bohrungen<2 Then MsgBox "Anzahl Bohrungen falsch" Exit Sub End If If A_Achse = 0 Then If (G73 = 1 Or G83 = 1) And Zustelltiefe = 0 Then MsgBox "Zustelltiefe kann nicht Null sein" Exit Sub End If If Durchmesser<=0 Then MsgBox "Durchmesser falsch" Exit Sub End If End If Nc = 0 PI = 3.1415926535898 Startwinkel = (Startwinkel*PI)/180 B= 2*PI/Anzahl_Bohrungen OpenTeachFile "Lochkreis.tap" Code "(Lochkreis)" Code "G0 G40 G17 G80 G50 G90 G21" Code "G0" + " Z" + CStr(Rueckzugebene) Code "M3 S" + CStr(GetOEMDRO(1120)) If GetUserLED(1128) Then 'Khlung Nebel Code"M07" End If If GetUserLED(1127) Then 'Khlung Schwall Code"M08" End If A_Weg = 0 Do X = Round (Mittelpunkt_X+(Durchmesser/2)*Cos (Startwinkel+B*Nc), 4) Y = Round (Mittelpunkt_Y+(Durchmesser/2)*Sin (Startwinkel+B*Nc), 4) If A_Achse = 0 Then Kommando = " X" + CStr(X) + " Y" + CStr(Y) Else Kommando = "A" + CStr(A_Weg) A_Weg = A_Weg + Round ((360 / Anzahl_Bohrungen),4) End If If G73 = 1 Then Kommando = "G73" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " Q" + CStr(Zustelltiefe) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G81 = 1 Then Kommando = "G81" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G82 = 1 Then Kommando = "G82" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " P" + CStr(Verweilzeit) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G83 = 1 Then Kommando = "G83" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " Q" + CStr(Zustelltiefe) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G85 = 1 Then Kommando = "G85" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G86 = 1 Then Kommando = "G86" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " P" + CStr(Verweilzeit) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G89 = 1 Then Kommando = "G89" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " P" + CStr(Verweilzeit) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If Code Kommando Nc = Nc+1 Loop While (Anzahl_Bohrungen-1) >= Nc Code "G80" Code"M5 M9" Code "M30" CloseTeachFile Call LoadTeachFile() DoOEMBUTTON(1) End Sub None%+.4f"Noneh Sub Main() DoOEMBUTTON (169) G73 = GetUserLED(1233) G81 = GetUserLED(1234) G82 = GetUserLED(1235) G83 = GetUserLED(1236) G85 = GetUserLED(1237) G86 = GetUserLED(1238) G89 = GetUserLED(1240) Man = GetUserLED(1239) Bohrtiefe = GetOEMDRO(1121) Zustelltiefe = GetOEMDRO(1122) Rueckzugebene = GetOEMDRO(1123) Rueckzug_um = GetOEMDRO(1124) Verweilzeit = GetOEMDRO(1125) Materialhoehe = GetOEMDRO(1126) Vorschub_Z = GetOEMDRO(1128) If Bohrtiefe = 0 Then MsgBox "Bohrtiefe kann nicht Null sein" Exit Sub End If If (G73 = 1 Or G83 = 1) And Zustelltiefe = 0 Then MsgBox "Zustelltiefe kann nicht Null sein" Exit Sub End If If Vorschub_Z <= 0 Then MsgBox "Vorschub Z zu klein" Exit Sub End If If GetOEMDRO(1120) < 100 Then MsgBox "Spindeldrehzahl zu gering" Exit Sub End If OpenTeachFile "Bohrzyklen.tap" Code "(Bohrpositionen)" Code "G0 G40 G17 G80 G50 G90 G21 " Code "G0" + " Z" + CStr(Rueckzugebene) Code "M3 S" + CStr(GetOEMDRO(1120)) If GetUserLED(1128) Then 'Khlung Nebel Code"M07" End If If GetUserLED(1127) Then 'Khlung Schwall Code"M08" End If For I = 1 To 20 Pos_X = GetOEMDRO(1150+i) Pos_Y = GetOEMDRO(1170+i) If Pos_X <> 0 Or Pos_Y <> 0 Then Kommando = " X" + CStr(Pos_X) + " Y" + CStr(Pos_Y) If G73 = 1 Then Kommando = "G73" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " Q" + CStr(Zustelltiefe) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G81 = 1 Then Kommando = "G81" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G82 = 1 Then Kommando = "G82" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " P" + CStr(Verweilzeit) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G83 = 1 Then Kommando = "G83" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " Q" + CStr(Zustelltiefe) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G85 = 1 Then Kommando = "G85" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G86 = 1 Then Kommando = "G86" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " P" + CStr(Verweilzeit) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If G89 = 1 Then Kommando = "G89" + Kommando Kommando = Kommando + " Z" + CStr((Bohrtiefe)*(-1)) Kommando = Kommando + " R" + CStr(Rueckzugebene) Kommando = Kommando + " P" + CStr(Verweilzeit) Kommando = Kommando + " F" + CStr(Vorschub_Z) End If If Man = 1 Then Code Kommando Kommando = "M0" End If Code Kommando End If Next i Code "G80" Code"M5 M9" Code "M30" CloseTeachFile Call LoadTeachFile() DoOEMBUTTON(1) End Sub None%+.4fG4"None/For I = 1151 To 1190 SetOEMDRO(I, 0) Next i None%+.4fGEc"NoneXIf GetUserLED(1127) = 0 Then setUserLED((1128),1) Else setUserLED((1128),0) End If None%+.4f "NoneWIf GetUserLED(1127) = 0 Then setUserLED((1127),1) Else setUserLED((1127),0) end if None%+.4f "None SetUserLED(1233,1) SetUserLED(1234,0) SetUserLED(1235,0) SetUserLED(1236,0) SetUserLED(1237,0) SetUserLED(1238,0) SetUserLED(1239,0) SetUserLED(1240,0) SetUserLED(1121,1) SetUserLED(1122,1) SetUserLED(1123,1) SetUserLED(1124,1) SetUserLED(1125,0) SetUserLED(1126,1) None%+.4f E;^"None SetUserLED(1233,0) SetUserLED(1234,0) SetUserLED(1235,0) SetUserLED(1236,0) SetUserLED(1237,1) SetUserLED(1238,0) SetUserLED(1239,0) SetUserLED(1240,0) SetUserLED(1121,1) SetUserLED(1122,0) SetUserLED(1123,1) SetUserLED(1124,0) SetUserLED(1125,0) SetUserLED(1126,1) None%+.4f c;|"None SetUserLED(1233,0) SetUserLED(1234,0) SetUserLED(1235,0) SetUserLED(1236,0) SetUserLED(1237,0) SetUserLED(1238,1) SetUserLED(1239,0) SetUserLED(1240,0) SetUserLED(1121,1) SetUserLED(1122,0) SetUserLED(1123,1) SetUserLED(1124,0) SetUserLED(1125,1) SetUserLED(1126,1) None%+.4fJc||"None SetUserLED(1233,0) SetUserLED(1234,0) SetUserLED(1235,0) SetUserLED(1236,0) SetUserLED(1237,0) SetUserLED(1238,0) SetUserLED(1239,0) SetUserLED(1240,1) SetUserLED(1121,1) SetUserLED(1122,0) SetUserLED(1123,1) SetUserLED(1124,0) SetUserLED(1125,1) SetUserLED(1126,1) None%+.4fc|"None SetUserLED(1233,0) SetUserLED(1234,0) SetUserLED(1235,0) SetUserLED(1236,0) SetUserLED(1237,0) SetUserLED(1238,0) SetUserLED(1239,1) SetUserLED(1240,0) SetUserLED(1121,0) SetUserLED(1122,0) SetUserLED(1123,1) SetUserLED(1124,0) SetUserLED(1125,0) SetUserLED(1126,0) None%+.4fc|"None SetUserLED(1233,0) SetUserLED(1234,0) SetUserLED(1235,0) SetUserLED(1236,1) SetUserLED(1237,0) SetUserLED(1238,0) SetUserLED(1239,0) SetUserLED(1240,0) SetUserLED(1121,1) SetUserLED(1122,1) SetUserLED(1123,1) SetUserLED(1124,0) SetUserLED(1125,0) SetUserLED(1126,1) None%+.4fE^"None SetUserLED(1233,0) SetUserLED(1234,0) SetUserLED(1235,1) SetUserLED(1236,0) SetUserLED(1237,0) SetUserLED(1238,0) SetUserLED(1239,0) SetUserLED(1240,0) SetUserLED(1121,1) SetUserLED(1122,1) SetUserLED(1123,1) SetUserLED(1124,0) SetUserLED(1125,0) SetUserLED(1126,1) None%+.4fE^"None SetUserLED(1233,0) SetUserLED(1234,1) SetUserLED(1235,0) SetUserLED(1236,0) SetUserLED(1237,0) SetUserLED(1238,0) SetUserLED(1239,0) SetUserLED(1240,0) SetUserLED(1121,1) SetUserLED(1122,0) SetUserLED(1123,1) SetUserLED(1124,0) SetUserLED(1125,0) SetUserLED(1126,1) None%+.4fJE|^ NoneNone NoneNonea%.3f  NoneNone NoneNoneb%.3f  NoneNone NoneNonec%.3f  NoneNone NoneNoned%.3f  NoneNone NoneNonee%.0f  NoneNone NoneNonef%.3f  NoneNone NoneNoneg%.0fS g NoneNone NoneNoneh%.0fl  NoneNone NoneNone`%.0f  NoneNone NoneNone%+.3fCEY NoneNone NoneNone%+.3fC^r NoneNone NoneNone%+.3fCw NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC ! NoneNone NoneNone%+.3fC&: NoneNone NoneNone%+.3fCXl NoneNone NoneNone%+.3fC?S NoneNone NoneNone%+.3fCq NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC NoneNone NoneNone%+.3fC 4 NoneNone NoneNone%+.3fE=Y NoneNone NoneNone%+.3f^=r NoneNone NoneNone%+.3fw= NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f =! NoneNone NoneNone%+.3f&=: NoneNone NoneNone%+.3f?=S NoneNone NoneNone%+.3fX=l NoneNone NoneNone%+.3fq= NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f< NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f= NoneNone NoneNone%+.3f =4 NoneNone NoneNonei%+.3fEY NoneNone NoneNonej%+.3f^r NoneNone NoneNonek%.3fw NoneNone NoneNonel%+.3f NoneNone NoneNonem%.0f NoneNone NoneNonen%+.3f!5 NoneNone NoneNoneo%+.3f:N NoneNone NoneNonep%+.3fSg NoneNone NoneNoneq%+.3fl NoneNone NoneNoner%.0f8NoneNone NoneNone%+.4f>EG^8NoneNone NoneNone%+.4f>cG|8NoneNone NoneNone%+.4fE^8NoneNone NoneNone%+.4fc|8NoneNone NoneNone%+.4fE^8NoneNone NoneNone%+.4fc|8NoneNone NoneNone%+.4fE ^8NoneNone NoneNone%+.4fc |8NoneNone NoneNonea%+.4f8NoneNone NoneNoneb%+.4f8NoneNone NoneNonec%+.4f8NoneNone NoneNoned%+.4fNoneNone NoneNone%+.4f8NoneNone NoneNonef%+.4f8NoneNone NoneNoneg%+.4f8NoneNone NoneNoneh%+.4fNoneNone ,autom. Kantenfinder Bitmaps\Bildschirm15.bmpLabel%+.4fL8NoneNone NoneNone%+.4f("NoneWIf getUserLED(1241) = 0 Then SetUserLED((1241),1) Else SetUserLED((1241),0) End If NoneNoner%+.4f5("None#Sub Main() X_Pos = GetOEMDRO(1014) Y_Pos = GetOEMDRO(1015) Laenge = GetOEMDRO(1016) Breite = GetOEMDRO(1017) Endtiefe = GetOEMDRO(1018) Schrittiefe = GetOEMDRO(1013) Letzter_Schnitt = GetOEMDRO(1019) Durchmesser = GetOEMDRO(1020) Sicher_Z = GetOEMDRO(1026) Ueberlappung = GetOEMDRO(1021) Vor_Schrupp = GetOEMDRO(1022) Vor_Schlicht = GetOEMDRO(1023) U_Schrupp = GetOEMDRO(1024) U_Schlicht = GetOEMDRO(1025) If GetUserLED(1242) = 1 Then Schwall = 1 Else Schwall = 0 End If If GetUserLED(1243) = 1 Then Nebel = 1 Else Nebel = 0 End If If GetUserLED(1241) = 1 Then Wechsel = 1 Else Wechsel = 0 End If Radius = Durchmesser / 2 If Abs(Laenge) <= Durchmesser*2 Then MsgBox "Werkzeugdurchmesser zu gro" Exit Sub End If If Abs(Breite) <= Durchmesser*2 Then MsgBox "Werkzeugdurchmesser zu gro" Exit Sub End If If Durchmesser <=0 Then MsgBox "Werkzeugdurchmesser darf nicht Null sein" Exit Sub End If If Laenge <=0 Then MsgBox "Lnge kann nicht Null sein" Exit Sub End If If Breite <=0 Then MsgBox "Breite kann nicht Null sein" Exit Sub End If If Ueberlappung <= 0 Then MsgBox "berlappung kann nicht Null sein" Exit Sub End If If Ueberlappung > 95 Then MsgBox "berlappung kann nicht grer als 95% sein" Exit Sub End If Ueberlappung = 100 - Ueberlappung If Letzter_Schnitt >= Schrittiefe Then MsgBox "Schlichttiefe kann nicht gleich/grsser Schrittiefe sein" Exit Sub End If If Vor_Schrupp = 0 Then MsgBox "Vorschub kann nicht Null sein" Exit Sub End If If Schrittiefe = 0 Then MsgBox "Schrittiefe kann nicht Null sein" Exit Sub End If If Endtiefe = 0 Then MsgBox "Endtiefe kann nicht Null sein" Exit Sub End If If U_Schrupp = 0 Then MsgBox "Drehzahl Schrupp kann nicht Null sein" Exit Sub End If If U_Schlicht = 0 Then U_schlicht = U_Schrupp End If If Schrittiefe > Endtiefe Then Schrittiefe = Endtiefe End If OpenTeachFile "Planfrsen.tap" Code "(Planfrsen)" Werkzeug_Offset = Durchmesser * 0.6 Ueberlappung = Ueberlappung / 100 Code "G0 G21 G49 G40 G17 G80 G50 G90 " If Wechsel = 1 Then Code"M06 T0"& "(Schruppfrser " & Durchmesser & ")" Else Code"M06 T0"& "(Frser " & Durchmesser & ")" End If Code"M03 S" & U_Schrupp If Schwall = 1 Then Code "M08" End If If Nebel = 1 Then Code "M07" End If Durchgang = 1 Endtiefe = Endtiefe * -1 If Laenge > Breite Then '******************** Lnge > Breite ******************* X_Anfang = X_Pos - Werkzeug_Offset + Radius Y_Anfang = Y_Pos - Werkzeug_Offset + Radius X_Ende = X_Pos + Laenge + Werkzeug_Offset - Radius Y_Ende = Y_Pos + Breite + Werkzeug_Offset - Radius XToolDown = X_Anfang - Werkzeug_Offset YToolDown = Y_Anfang Do Tiefe_Durchgang = 0 - Durchgang * Schrittiefe If Tiefe_Durchgang <= Endtiefe Then Tiefe = Endtiefe + Letzter_Schnitt Else Tiefe = Tiefe_Durchgang End If Code "G00 Z" & Sicher_Z Code "G00 X" & XToolDown & " Y" & YToolDown Code "G00 Z0.1" Code "G01 Z" & nfmt(Tiefe, 4) & " F50" Code "F" & Vor_Schrupp PassType = 1 YpassNo = 0 Do YofPass = Y_Anfang + (Durchmesser * Ueberlappung * YpassNo) If (YofPass >= Y_Ende) Then Exit Do End If Code "G01 Y" & YofPass Code "G01 X" & X_Ende PassType = PassType * -1 YpassNo = YpassNo + 1 YofPass = Y_Anfang + (Durchmesser * Ueberlappung * YpassNo) If (YofPass >= Y_Ende) Then Exit Do End If Code "G01 Y" & YofPass Code "G01 X" & X_Anfang PassType = PassType * -1 YpassNo = YpassNo + 1 Loop YofPass = Y_Ende Code "G01 Y" & YofPass If PassType = 1 Then Code "G01 X" & X_Ende Else Code "G01 X" & X_Anfang End If Durchgang = Durchgang + 1 If Tiefe_Durchgang - Letzter_Schnitt <= Endtiefe Or Durchgang > 2000 Then Exit Do End If Loop If Letzter_Schnitt <> 0 Then PassType = 1 Code "G00 Z" & Sicher_Z If Wechsel = 1 Then Code "M09" Code "M06 T0"& "(Schlichtfrser " & Durchmesser & ")" Code "M03 S" & U_Schlicht If Schwall = 1 Then Code "M08" End If If Nebel = 1 Then Code "M07" End If End If Code "G00 X" & XToolDown & " Y" & YToolDown Code "G00 Z0.1" Code "G01 Z" & Endtiefe & " F50" Code "F" & Vor_Schlicht YpassNo = 0 Do YofPass = Y_Anfang + (Durchmesser * Ueberlappung * YpassNo) If (YofPass >= Y_Ende) Then Exit Do End If Code "G01 Y" & YofPass Code "G01 X" & X_Ende PassType = PassType * -1 YpassNo = YpassNo + 1 YofPass = Y_Anfang + (Durchmesser * Ueberlappung * YpassNo) If (YofPass >= Y_Ende) Then Exit Do End If Code "G01 Y" & YofPass Code "G01 X" & X_Anfang PassType = PassType * -1 YpassNo = YpassNo + 1 Loop YofPass = Y_Ende Code "G01 Y" & YofPass If (PassType = 1) Then Code "G01 X" & X_Ende Else Code "G01 X" & X_Anfang End If End If Code "G00 Z" & Sicher_Z Code "G00 X" & XToolDown & " Y" & YToolDown Else '******************** Breite > Lnge ******************* X_Anfang = X_Pos - Werkzeug_Offset + Radius Y_Anfang = Y_Pos - Werkzeug_Offset + Radius X_Ende = X_Pos + Laenge + Werkzeug_Offset - Radius Y_Ende = Y_Pos + Breite + Werkzeug_Offset - Radius XToolDown = X_Anfang YToolDown = Y_Anfang - Werkzeug_Offset - Durchmesser Do Tiefe_Durchgang = 0 - Durchgang * Schrittiefe If Tiefe_Durchgang <= Endtiefe Then Tiefe = Endtiefe + Letzter_Schnitt Else Tiefe = Tiefe_Durchgang End If Code "G00 Z" & Sicher_Z Code "G00 X" & XToolDown & " Y" & YToolDown Code "G00 Z0.1" Code "G01 Z" & nfmt(Tiefe,4) & " F50" Code "F" & Vor_Schrupp PassType = 1 XpassNo = 0 Do XofPass = X_Anfang + (Durchmesser * Ueberlappung * XpassNo) If (XofPass >= X_Ende) Then Exit Do End If Code "G01 X" & XofPass Code "G01 Y" & Y_Ende PassType = PassType * -1 XpassNo = XpassNo + 1 XofPass = X_Anfang + (Durchmesser * Ueberlappung * XpassNo) If (XofPass >= X_Ende) Then Exit Do End If Code "G01 X" & XofPass Code "G01 Y" & Y_Anfang PassType = PassType * -1 XpassNo = XpassNo + 1 Loop XofPass = X_Ende Code "G01 X" & XofPass If (PassType = 1) Then Code "G01 Y" & Y_Ende Else Code "G01 Y" & Y_Anfang End If Durchgang = Durchgang + 1 If Tiefe_Durchgang - Letzter_Schnitt <= Endtiefe Or Durchgang > 2000 Then Exit Do End If Loop If Letzter_Schnitt <> 0 Then PassType = 1 Tiefe_Durchgang = 0 - Endtiefe + Letzter_Schnitt Code "G00 Z" & Sicher_Z If Wechsel = 1 Then Code "M09" Code "M06 T0"& "(Schlichtfrser " & Durchmesser & ")" Code "M03 S" & U_Schlicht If Schwall = 1 Then Code "M08" End If If Nebel = 1 Then Code "M07" End If End If Code "G00 X" & XToolDown & " Y" & YToolDown Code "G00 Z0.1" Code "G01 Z" & Endtiefe & " F50" Code "F" & Vor_Schrupp XpassNo = 0 Do XofPass = X_Anfang + (Durchmesser * Ueberlappung * XpassNo) If (XofPass >= X_Ende) Then Exit Do End If Code "G01 X" & XofPass Code "G01 Y" & Y_Ende PassType = PassType * -1 XpassNo = XpassNo + 1 XofPass = X_Anfang + (Durchmesser * Ueberlappung * XpassNo) If (XofPass >= X_Ende) Then Exit Do End If Code "G01 X" & XofPass Code "G01 Y" & Y_Anfang PassType = PassType * -1 XpassNo = XpassNo + 1 Loop XofPass = X_Ende Code "G01 X" & XofPass If PassType = 1 Then Code "G01 Y" & Y_Ende Else Code "G01 Y" & Y_Anfang End If End If Code "G00 Z" & Sicher_Z Code "G00 X" & XToolDown & " Y" & YToolDown End If Code "M30" CloseTeachFile Call LoadTeachFile DoOEMButton(1) End Sub NoneNone%+.4f;8NoneNone NoneNone%+.4f 8NoneNone NoneNone%+.4f"NoneXIf getUserLED(1243) = 0 Then SetUserLED((1243),1) Else SetUserLED((1243),0) End If NoneNone%+.4f5 "NoneXIf getUserLED(1242) = 0 Then SetUserLED((1242),1) Else SetUserLED((1242),0) End If NoneNone%+.4f5 NoneNone NoneNone%.3f NoneNone NoneNone%.3f~ NoneNone NoneNone%.3f?7S NoneNone NoneNone%.3f$8 NoneNone NoneNone%.0f=Q NoneNone NoneNone%.3f NoneNone NoneNone%.0fVj NoneNone NoneNone%.0fo NoneNone NoneNone%.0f NoneNone NoneNone%.0f NoneNone NoneNone%+.3f NoneNone NoneNone%+.3f NoneNone NoneNone%.3f_ NoneNone NoneNone%.3fJlNoneNone ,autom. Kantenfinder Bitmaps\Bildschirm16.bmpLabel%+.4fL"NoneREM Kreis Sub Main() X_Pos = GetOEMDRO(1029) Y_Pos = GetOEMDRO(1030) Endtiefe = GetOEMDRO(1031) Schrittiefe = GetOEMDRO(1027) Durchmesser = GetOEMDRO(1035) Sicher_Z = GetOEMDRO(1042) Vor_Schrupp = GetOEMDRO(1036) Vor_Schlicht = GetOEMDRO(1037) Vor_Z = GetOEMDRO(1038) U_Schrupp = GetOEMDRO(1039) U_Schlicht = GetOEMDRO(1040) AnzahlSchlicht = GetOEMDRO(1041) Schlicht_Aussen = GetOEMDRO(1032) Schlicht_Innen = GetOEMDRO(1028) Durchmesser_Aussen = GetOEMDRO(1033) Durchmesser_Innen = GetOEMDRO(1034) If Durchmesser_Aussen = 0 And Durchmesser_Innen = 0 Then MsgBox "Kreisdurchmesser fehlt" Exit Sub End If If Durchmesser_Aussen <> 0 And Durchmesser_Innen <> 0 Then MsgBox "Sie mssen sich zwischen Innen- und Auendurchmesser entscheiden" Exit Sub End If If Durchmesser_Aussen <> 0 And Schlicht_Innen <> 0 Then MsgBox "Durchmesser auen und Schlichtma innen passen nicht zusammen" Exit Sub End If If Durchmesser_Innen <> 0 And Schlicht_Aussen <> 0 Then MsgBox "Durchmesser innen und Schlichtma auen passen nicht zusammen" Exit Sub End If If Durchmesser_Aussen <> 0 Then Kreis = Durchmesser_Aussen Aufmass = Schlicht_Aussen Innen = 0 Else Kreis = Durchmesser_Innen Aufmass = Schlicht_Innen Innen = 1 End If If GetUserLED(1244) = 1 Then Schwall = 1 Else Schwall = 0 End If If GetUserLED(1245) = 1 Then Nebel = 1 Else Nebel = 0 End If If GetUserLED(1246) = 1 Then Wechsel = 1 Else Wechsel = 0 End If If Durchmesser = 0 Then MsgBox "Werkzeugdurchmesser darf nich Null sein" Exit Sub End If If Innen = 1 And Kreis < (Durchmesser + Aufmass * 2 + 0.2) Then MsgBox "Werkzeugdurchmesser zu gro" Exit Sub End If If Vor_Schrupp = 0 Then MsgBox "Vorschub Schruppen kann nicht Null sein" Exit Sub End If If Vor_Z = 0 Then MsgBox "Vorschub Eintauchen kann nicht Null sein" Exit Sub End If If Aufmass > 0 And Vor_Schlicht = 0 Then MsgBox "Vorschub Schlichten kann nicht Null sein" Exit Sub End If If Schrittiefe = 0 Then MsgBox "Schritttiefe kann nicht Null sein" Exit Sub End If If Schrittiefe > Endtiefe Then MsgBox "Schritttiefe kann nicht grer Endtiefe sein" Exit Sub End If If Aufmass > 0 And Aufmass > Durchmesser / 10 Then MsgBox "Schlichtaufmass zu gro" Exit Sub End If Endtiefe = Endtiefe * -1 Schrittiefe = Schrittiefe * -1 OpenTeachFile "Kreis.tap" Code "(Kreis frsen)" Code "G0 G21 G49 G40 G17 G80 G50 G90 G90.1" If Wechsel = 1 Then Code"M6 T0"& "(Schruppfrser " & Durchmesser & ")" Else Code"M6 T0"& "(Frser " & Durchmesser & ")" End If Code"M03 S" & U_Schrupp If Schwall = 1 Then Code"M08" End If If Nebel = 1 Then Code"M07" End If Durchgang= 1 RadiusWerkzeug = Durchmesser / 2 If Innen = 1 Then RadiusKreis = (Kreis / 2) - RadiusWerkzeug - Aufmass Else RadiusKreis = (Kreis / 2) + RadiusWerkzeug + Aufmass End If LetzteTiefe = 0 Code "G00 Z" & Sicher_Z Do TiefeDurchgang = Durchgang * Schrittiefe If TiefeDurchgang < Endtiefe Then TiefeDurchgang = Endtiefe End If Winkel = Abs((TiefeDurchgang + LetzteTiefe) * 1.5) / (RadiusKreis * 2 * 3.141593) * 360 If Winkel > 360 Then Winkel = 360 End If Code "G00 X" & X_Pos + RadiusKreis & " Y" & Y_Pos Code "G00 Z" & 0.1 - LetzteTiefe If Winkel > 270 Then Code "G02 X" & X_Pos + RadiusKreis & " Y" & Y_Pos & " Z" & TiefeDurchgang _ & " I" & X_Pos & " J" & Y_Pos & " F" & Vor_Z Code "G02 X" & X_Pos + RadiusKreis & " Y" & Y_Pos _ & " I" & X_Pos & " J" & Y_Pos & " F" & Vor_Schrupp Else If Winkel > 180 Then H = RadiusKreis * Sin((Winkel - 180) * 3.141593 / 180) B = H / Tan((Winkel - 180) * 3.141593 / 180) Code "G02 X" & nFmt(X_Pos - B, 4) & " Y" & nFmt(Y_Pos + H, 4) & " Z" & TiefeDurchgang _ & " I" & X_Pos & " J" & Y_Pos & " F" & Vor_Z Code "G02 X" & nFmt(X_Pos - B, 4) & " Y" & nFmt(Y_Pos + H, 4) _ & " I" & X_Pos & " J" & Y_Pos & " F" & Vor_Schrupp Else If Winkel > 90 Then H = RadiusKreis * Sin((Winkel - 90) * 3.141593 / 180) B = H / Tan((Winkel - 90) * 3.141593 / 180) Code "G02 X" & nFmt(X_Pos - H, 4) & " Y" & nFmt(Y_Pos - B, 4) _ & " Z" & TiefeDurchgang & " I" & X_Pos & " J" & Y_Pos & " F" & Vor_Z Code "G02 X" & nFmt(X_Pos - H, 4) & " Y" & nFmt(Y_Pos - B, 4) _ & " I" & X_Pos & " J" & Y_Pos & " F" & Vor_Schrupp Else H = RadiusKreis * Sin((Winkel) * 3.141593 / 180) B = H / Tan((Winkel) * 3.141593 / 180) Code "G02 X" & nFmt(X_Pos + B, 4) & " Y" & nFmt(Y_Pos - H, 4) _ & " Z" & TiefeDurchgang & " I" & X_Pos & " J" & Y_Pos & " F" & Vor_Z Code "G02 X" & nFmt(X_Pos + B, 4) & " Y" & nFmt(Y_Pos - H, 4) _ & " I" & X_Pos & " J" & Y_Pos & " F" & Vor_Schrupp End If End If End If Code "G00 Z" & Sicher_Z Durchgang = Durchgang + 1 LetzteTiefe = LetzteTiefe - Schrittiefe Loop While TiefeDurchgang > Endtiefe If Aufmass > 0 Then msgbox "Vor dem Schlichtvorgang mssen Sie unbedingt das aus- oder abgeschnittene Material entfernen, da die zu schlichtend Kontur im Bogen angefahren wird" If Wechsel = 1 Then Code "G00 Z" & Sicher_Z Code "M09" Code "M6 T0"& "(Schlichtfrser " & Durchmesser & ")" Code "M03 S" & U_Schlicht If Schwall = 1 Then Code"M08" End If If Nebel = 1 Then Code"M07" End If Else Code "G00 Z" & Sicher_Z Code "M05 M09" Code "M00" & "(Aus-/Abgeschnittenes Material unbedingt entfernen!)" Code "M03 S" & U_Schlicht If Schwall = 1 Then Code"M08" End If If Nebel = 1 Then Code"M07" End If End If Abfahrt = Durchmesser * 3 / 10 If Innen = 1 Then 'Schlichten innen RadiusKreis = (Kreis / 2) - RadiusWerkzeug If Abfahrt > RadiusKreis Then Abfahrt = RadiusKreis End If Do If Abfahrt > 0 Then If RadiusKreis > Abfahrt Then Code "G00 Y" & Y_Pos - Abfahrt & " X" & X_Pos + RadiusKreis - Abfahrt Code "G00 Z0.1" Code "G03 Y" & Y_Pos & " X" & X_Pos + RadiusKreis & " Z" & Endtiefe & " R" & Abfahrt & " F" & Vor_Z Else Code "G00 Y" & Y_Pos - RadiusKreis / 2 & " X" & X_Pos + RadiusKreis / 2 Code "G00 Z0.1" Code "G03 Y" & Y_Pos & " X" & X_Pos + RadiusKreis & " Z" & Endtiefe & " R" & RadiusKreis / 2 & " F" & Vor_Z End If End If Code "Y" & Y_Pos & " X" & X_Pos - RadiusKreis & " R" & RadiusKreis & " F" & Vor_Schlicht Code "Y" & Y_Pos & " X" & X_Pos + RadiusKreis & " R" & RadiusKreis If Abfahrt > 0 Then If RadiusKreis > Abfahrt Then Code "Y" & Y_Pos + Abfahrt & " X" & X_Pos + RadiusKreis - Abfahrt & " R" & Abfahrt & " F" & Vor_Z Else Code "Y" & Y_Pos + RadiusKreis / 2 & " X" & X_Pos + RadiusKreis - RadiusKreis / 2 & " R" & RadiusKreis / 2 & " F" & Vor_Z End If End If Code "G00 Z" & Sicher_Z AnzahlSchlicht = AnzahlSchlicht -1 Loop While AnzahlSchlicht > 0 Else 'Schlichten aussen RadiusKreis = (Kreis / 2) + RadiusWerkzeug Do Code "G00 Y" & Y_Pos + Abfahrt & " X" & X_Pos + RadiusKreis + Abfahrt Code "G00 Z0.1" Code "G03 Y" & Y_Pos & " X" & X_Pos + RadiusKreis & " Z" & Endtiefe & " R" & Abfahrt & " F" & Vor_Z Code "G02 Y" & Y_Pos & " X" & X_Pos - RadiusKreis & " R" & RadiusKreis & " F" & Vor_Schlicht Code "G02 Y" & Y_Pos & " X" & X_Pos + RadiusKreis & " R" & RadiusKreis Code "G03 Y" & Y_Pos - Abfahrt & " X" & X_Pos + RadiusKreis + Abfahrt & " R" & Abfahrt & " F" & Vor_Z Code "G00 Z" & Sicher_Z AnzahlSchlicht = AnzahlSchlicht -1 Loop While AnzahlSchlicht > 0 End If End If Code"M5 M9" Code"M30" CloseTeachFile Call LoadTeachFile() DoOEMButton(1) End Sub Main NoneNone%+.4f$B8NoneNone NoneNone%+.4f(A8NoneNone NoneNone%+.4f #8NoneNone NoneNone%+.4f"NoneXIf GetUserLED(1246) = 0 Then SetUserLED((1246),1) Else SetUserLED((1246),0) End If NoneNone%+.4f6(A"NoneWIf GetUserLED(1244) = 0 Then SetUserLED((1244),1) Else SetUserLED((1244),0) End If NoneNone%+.4f6"NoneXIf GetUserLED(1245) = 0 Then SetUserLED((1245),1) Else SetUserLED((1245),0) End If NoneNone%+.4f6 # NoneNone NoneNone%.3f- NoneNone NoneNone%+.3fI. NoneNone NoneNone%+.3fI NoneNone NoneNone%.3f NoneNone NoneNone %.3f NoneNone NoneNone %.3fRf NoneNone NoneNone%.3f- NoneNone NoneNone%.3f5tI NoneNone NoneNone%.3f NoneNone NoneNone%.0f NoneNone NoneNone%.0f NoneNone NoneNone%.0f NoneNone NoneNone%.0fo NoneNone NoneNone %.0fVj NoneNone NoneNone %.0f=Q NoneNone NoneNone %.3f$8NoneNone ,autom. Kantenfinder Bitmaps\Bildschirm17.bmpLabel%+.4fL"None~'Sub Main() X_Pos = GetOEMDRO(1047) Y_Pos = GetOEMDRO(1048) Endtiefe = GetOEMDRO(1049) Schrittiefe = GetOEMDRO(1046) Durchmesser = GetOEMDRO(1054) Sicher_Z = GetOEMDRO(1061) Vor_Schrupp = GetOEMDRO(1055) Vor_Schlicht = GetOEMDRO(1056) Vor_Z = GetOEMDRO(1057) U_Schrupp = GetOEMDRO(1058) U_Schlicht = GetOEMDRO(1059) AnzahlSchlicht = GetOEMDRO(1060) Laenge_innen = GetOEMDRO(1053) Breite_innen = GetOEMDRO(1044) Laenge_aussen = GetOEMDRO(1052) Breite_aussen = GetOEMDRO(1045) Schlicht_innen = GetOEMDRO(1051) Schlicht_aussen = GetOEMDRO(1050) If Laenge_aussen <> 0 And Laenge_innen <> 0 Then MsgBox "Lnge innen und Lnge auen gleichzeitig" Exit Sub End If If Breite_aussen <> 0 And Breite_innen <> 0 Then MsgBox "Breite innen und Breite auen gleichzeitig" Exit Sub End If If Laenge_aussen <> 0 And Breite_innen <> 0 Then MsgBox "Lnge auen und Breite innen gleichzeitig" Exit Sub End If If Breite_aussen <> 0 And Laenge_innen <> 0 Then MsgBox "Breite auen und Lnge innen gleichzeitig" Exit Sub End If If Laenge_aussen <> 0 And Breite_aussen = 0 Then MsgBox "Nur Laenge auen" Exit Sub End If If Laenge_innen <> 0 And Breite_innen = 0 Then MsgBox "Nur Laenge innen" Exit Sub End If If Breite_aussen <> 0 And Laenge_aussen = 0 Then MsgBox "Nur Breite auen" Exit Sub End If If Breite_innen <> 0 And Laenge_innen = 0 Then MsgBox "Nur Breite innen" Exit Sub End If If Laenge_aussen = 0 And Breite_aussen = 0 And Laenge_innen = 0 And Breite_innen = 0 Then MsgBox "Keine Mae fr Rechteck" Exit Sub End If If Schlicht_innen <> 0 And Schlicht_aussen <> 0 Then MsgBox "Schlichtm innen UND auen" Exit Sub End If If Laenge_aussen <> 0 Then Innen = 0 If Schlicht_innen <> 0 Then MsgBox "Schlichtma innen fr Auenkontur" Exit Sub Else Aufmass = Schlicht_aussen Laenge = Laenge_aussen Breite = Breite_aussen End If Else Innen = 1 If Schlicht_aussen <> 0 Then MsgBox "Schlichtma auen fr Innenkontur" Exit Sub Else Aufmass = Schlicht_innen Laenge = Laenge_innen Breite = Breite_innen End If End If If GetUserLED(1247) = 1 Then Schwall = 1 Else Schwall = 0 End If If GetUserLED(1248) = 1 Then Nebel = 1 Else Nebel = 0 End If If GetUserLED(1249) = 1 Then Wechsel = 1 Else Wechsel = 0 End If If Durchmesser = 0 Then MsgBox "Werkzeugdurchmesser darf nicht Null sein" Exit Sub End If If Laenge + Aufmass * 2 <= Durchmesser Then Code "(Werkzeugdurchmesser zu gro)" Exit Sub End If If Breite + Aufmass * 2 <= Durchmesser Then Code "(Werkzeugdurchmesser zu gro)" Exit Sub End If If Vor_Schrupp = 0 Then MsgBox "Vorschub Schruppen kann nicht Null sein" Exit Sub End If If Vor_Z = 0 Then MsgBox "Vorschub Eintauchen kann nicht Null sein" Exit Sub End If If Aufmass > 0 And Vor_Schlicht = 0 Then MsgBox "Vorschub Schlichten kann nicht Null sein" Exit Sub End If If Schrittiefe = 0 Then MsgBox "Schritttiefe kann nicht Null sein" Exit Sub End If If Schrittiefe > Endtiefe Then MsgBox "Schritttiefe kann nicht grer Endtiefe sein" Exit Sub End If If Aufmass > 0 And Aufmass > Durchmesser / 10 Then MsgBox "Schlichtaufmass zu gro" Exit Sub End If Endtiefe = Endtiefe * -1 Schrittiefe = Schrittiefe * -1 OpenTeachFile "Rechteck.tap" Code "G0 G21 G49 G40 G17 G80 G50 G90 G90.1" If Wechsel = 1 Then Code"M6 T0"& "(Schruppfrser " & Durchmesser & ")" Else Code"M6 T0"& "(Frser " & Durchmesser & ")" End If Code"M03 S" & U_Schrupp If Schwall = 1 Then Code"M08" End If If Nebel = 1 Then Code"M07" End If Korrektur = Durchmesser / 2 + Aufmass If innen = 1 Then X_Start = X_Pos + Laenge / 2 Y_Start = Y_Pos + Breite - Korrektur E1 = X_Pos + Korrektur E2 = Y_Pos + Korrektur E3 = X_Pos + Laenge - Korrektur E4 = Y_Pos + Breite - Korrektur Else X_Start = X_Pos + Laenge / 2 Y_Start = Y_Pos + Breite + Korrektur E1 = X_Pos - Korrektur E2 = Y_Pos - Korrektur E3 = X_Pos +Laenge + Korrektur E4 = Y_Pos + Breite + Korrektur End If Durchgang= 1 LetzteTiefe = 0 Letztes_Z = 0 Do TiefeDurchgang = Durchgang * Schrittiefe If TiefeDurchgang < Endtiefe Then TiefeDurchgang = Endtiefe End If Rampe = Abs((TiefeDurchgang + LetzteTiefe) * 1.5) Ende = 0 Code "G00 Z" & Sicher_Z Code "G00 X" & nfmt(X_Start, 4) & " Y" & nfmt(Y_Start, 4) Code "G00 Z0.1" Code "G01 Z" & nfmt(LetzteTiefe * -1, 4) Do If Rampe <= 0 Then Code "X" & nfmt(E1, 4) & " F" & Vor_schrupp Else If Rampe > (X_Start - E1) Then Rampe = Rampe - (X_Start - E1) Letztes_Z = Letztes_Z + (X_Start - E1) / -1.5 Code "X" & nfmt(E1, 4) & " Z" & nfmt(Letztes_Z, 4) & " F" & Vor_Z Else Code "X" & nfmt(X_Start - Rampe, 4) & " Z" & TiefeDurchgang & " F" & Vor_Z Code "X" & nfmt(E1, 4) & " F" & Vor_Schrupp Ende = 1 End_Pos = X_Start - Rampe Rampe = 0 End If End If If Rampe <= 0 Then Code "Y" & nfmt(E2, 4) & " F" & Vor_schrupp Else If Rampe > (Y_Start - E2) Then Rampe = Rampe - (Y_Start - E2) Letztes_Z = Letztes_Z + (Y_Start - E2) / -1.5 Code "Y" & nfmt(E2, 4) & " Z" & nfmt(Letztes_Z, 4) & " F" & Vor_Z Else Code "Y" & nfmt(Y_Start - Rampe, 4) & " Z" & TiefeDurchgang & " F" & Vor_Z Code "Y" & nfmt(E2, 4) & " F" & Vor_Schrupp Ende = 2 End_Pos = Y_Start - Rampe Rampe = 0 End If End If If Rampe <= 0 Then Code "X" & nfmt(E3, 4) & " F" & Vor_schrupp Else If Rampe > (E3 - E1) Then Rampe = Rampe - (E3 - E1) Letztes_Z = Letztes_Z + (E3 - E1) / -1.5 Code "X" & nfmt(E3, 4) & " Z" & nfmt(Letztes_Z, 4) & " F" & Vor_Z Else Code "X" & nfmt(E1 + Rampe, 4) & " Z" & TiefeDurchgang & " F" & Vor_Z Code "X" & nfmt(E3, 4) & " F" & Vor_Schrupp Ende = 3 End_Pos = E1 + Rampe Rampe = 0 End If End If If Rampe <= 0 Then Code "Y" & nfmt(E4, 4) & " F" & Vor_schrupp Else If Rampe > (E4 - E2) Then Rampe = Rampe - (E4 - E2) Letztes_Z = Letztes_Z + (E4 - E2) / -1.5 Code "Y" & nfmt(E4, 4) & " Z" & nfmt(Letztes_Z, 4) & " F" & Vor_Z Else Code "Y" & nfmt(E2 + Rampe, 4) & " Z" & TiefeDurchgang & " F" & Vor_Z Code "Y" & nfmt(E4, 4) & " F" & Vor_Schrupp Ende = 4 End_Pos = E2 + Rampe Rampe = 0 End If End If If Rampe <= 0 Then Code "X" & nfmt(X_Start, 4) & " F" & Vor_schrupp Else If Rampe > (E4 - X_Start) Then Rampe = Rampe - (E4 - X_Start) Letztes_Z = Letztes_Z + (X_Start - E1) / -1.5 Code "X" & nfmt(X_Start, 4) & " Z" & nfmt(Letztes_Z, 4) & " F" & Vor_Z Else Code "X" & nfmt(E4 - Rampe, 4) & " Z" & TiefeDurchgang & " F" & Vor_Z Code "X" & nfmt(X_Start, 4) & " F" & Vor_Schrupp Ende = 5 End_Pos = E4 - Rampe Rampe = 0 End If End If Loop While Rampe > 0 Select Case Ende Case 1 Code "X" & nfmt(End_Pos, 4) Case 2 Code "X" & nfmt(E1, 4) Code "Y" & nfmt(End_Pos, 4) Case 3 Code "X" & nfmt(E1, 4) Code "Y" & nfmt(E2, 4) Code "X" & nfmt(End_Pos, 4) Case 4 Code "X" & nfmt(E1, 4) Code "Y" & nfmt(E2, 4) Code "X" & nfmt(E3, 4) Code "Y" & nfmt(End_Pos, 4) Case 5 Code "X" & nfmt(E1, 4) Code "Y" & nfmt(E2, 4) Code "X" & nfmt(E3, 4) Code "Y" & nfmt(E4, 4) Code "X" & nfmt(End_Pos, 4) Case Else End Select Letztes_Z = Durchgang * Schrittiefe Durchgang = Durchgang +1 LetzteTiefe = LetzteTiefe - Schrittiefe Loop While TiefeDurchgang > Endtiefe If Aufmass > 0 Then msgbox "Vor dem Schlichtvorgang mssen Sie unbedingt das aus- oder abgeschnittene Material entfernen, da die zu schlichtend Kontur im Bogen angefahren wird" If Wechsel = 1 Then Code "G00 Z" & Sicher_Z Code "M09" Code "M6 T0"& "(Schlichtfrser " & Durchmesser & ")" Code "M03 S" & U_Schlicht If Schwall = 1 Then Code"M08" End If If Nebel = 1 Then Code"M07" End If Else Code "G00 Z" & Sicher_Z Code "M05 M09" Code "M00" & "(Aus-/Abgeschnittenes Material unbedingt entfernen!)" Code "M03 S" & U_Schlicht If Schwall = 1 Then Code"M08" End If If Nebel = 1 Then Code"M07" End If End If Werkzeugradius = Durchmesser / 2 Abfahrt = Durchmesser * 0.3 If Innen = 1 Then Do If Abfahrt > 0 And Laenge > (Abfahrt * 2 + Werkzeugradius * 2 + 0.2) And Breite > (Abfahrt *2 + Werkzeugradius * 2 + 0.2) Then Code "G00 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite - Abfahrt * 2 - Werkzeugradius Code "G00 Z0.1" Code "G03 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite - Werkzeugradius & " Z" & Endtiefe & " R" & Abfahrt & " F" & Vor_Z Code "F" & Vor_Schlicht Code "G01" Code "X" & X_Pos + Werkzeugradius Code "Y" & Y_Pos + Werkzeugradius Code "X" & X_Pos + Laenge - Werkzeugradius Code "Y" & Y_Pos + Breite - Werkzeugradius Code "X" & X_Pos + Laenge / 2 Code "G03 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite - Abfahrt * 2 - Werkzeugradius & " R" & Abfahrt Else Code "G00 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite - Werkzeugradius Code "G00 Z" & Endtiefe Code "F" & Vor_Schlicht Code "G01" Code "X" & X_Pos + Werkzeugradius Code "Y" & Y_Pos + Werkzeugradius Code "X" & X_Pos + Laenge - Werkzeugradius Code "Y" & Y_Pos + Breite - Werkzeugradius Code "X" & X_Pos + Laenge / 2 End If AnzahlSchlicht = AnzahlSchlicht - 1 Loop While AnzahlSchlicht > 0 Else Do Code "G00 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite + Abfahrt * 2 + Werkzeugradius Code "G00 Z0.1" Code "G03 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite + Werkzeugradius & " Z" & Endtiefe & " R" & Abfahrt & " F" & Vor_Z Code "F" & Vor_Schlicht Code "G01" Code "X" & X_Pos + Laenge + Werkzeugradius Code "Y" & Y_Pos - Werkzeugradius Code "X" & X_Pos - Werkzeugradius Code "Y" & Y_Pos + Breite + Werkzeugradius Code "X" & X_Pos + Laenge / 2 Code "G03 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite + Abfahrt * 2 + Werkzeugradius & " R" & Abfahrt AnzahlSchlicht = AnzahlSchlicht - 1 Loop While AnzahlSchlicht > 0 End If End If Code "G00 Z" & Sicher_Z Code"M5 M9" Code"M30" CloseTeachFile Call LoadTeachFile() DoOEMButton(1) End Sub Main NoneNone%+.4f#A"NoneXIf GetUserLED(1249) = 0 Then SetUserLED((1249),1) Else SetUserLED((1249),0) End If NoneNone%+.4f6'@"NoneYIf GetUserLED(1248) = 0 Then SetUserLED((1248),1) Else SetUserLED((1248),0) End If NoneNone%+.4f7 ""NoneXIf GetUserLED(1247) = 0 Then SetUserLED((1247),1) Else SetUserLED((1247),0) End If NoneNone%+.4f68NoneNone NoneNone%+.4f'@8NoneNone NoneNone%+.4f "8NoneNone NoneNone%+.4f NoneNone NoneNone$%.0f NoneNone NoneNone#%.0f NoneNone NoneNone"%.0f NoneNone NoneNone!%.0fn NoneNone NoneNone %.0fUi NoneNone NoneNone%.0f<P NoneNone NoneNone%+.3f NoneNone NoneNone%+.3f NoneNone NoneNone%%.3f NoneNone NoneNone%.3f#7 NoneNone NoneNone%.3f( NoneNone NoneNone%.3f  o4 NoneNone NoneNone%.3f NoneNone NoneNone%.3f$& NoneNone NoneNone%.3fB NoneNone NoneNone%.3falu NoneNone NoneNone%.3f  NoneNone NoneNone%.3fNoneNone ,autom. Kantenfinder Bitmaps\Bildschirm18.bmpLabel%+.4fL NoneNone NoneNone4%.0f<P"None REM Kreistasche Sub Main() X_Pos = GetOEMDRO(1063) Y_Pos = GetOEMDRO(1064) Endtiefe = GetOEMDRO(1065) Schrittiefe = GetOEMDRO(1062) Durchmesser = GetOEMDRO(1068) Tasche = GetOEMDRO(1067) Aufmass = GetOEMDRO(1066) Sicher_Z = GetOEMDRO(1075) Ueberlappung = GetOEMDRO(1076) Vor_Schrupp = GetOEMDRO(1069) Vor_Schlicht = GetOEMDRO(1070) Vor_Z = GetOEMDRO(1071) U_Schrupp = GetOEMDRO(1072) U_Schlicht = GetOEMDRO(1073) AnzahlSchlicht = GetOEMDRO(1074) If GetUserLED(1250) = 1 Then Schwall = 1 Else Schwall = 0 End If If GetUserLED(1251) = 1 Then Nebel = 1 Else Nebel = 0 End If If GetUserLED(1252) = 1 Then Wechsel = 1 Else Wechsel = 0 End If If Durchmesser = 0 Then MsgBox "Werkzeugdurchmesser darf nicht Null sein" Exit Sub End If If Ueberlappung = 0 Then MsgBox "berlappung kann nicht Null sein" Exit Sub End If If Ueberlappung > 95 Then MsgBox "berlappung kann nicht grer als 95% sein" Exit Sub End If Ueberlappung = 100 - Ueberlappung If Tasche < (Durchmesser + Aufmass * 2 + 0.2) Then MsgBox "Werkzeugdurchmesser zu gro" Exit Sub End If If Vor_Schrupp = 0 Then MsgBox "Vorschub Schruppen kann nicht Null sein" Exit Sub End If If Vor_Z = 0 Then MsgBox "Vorschub Eintauchen kann nicht Null sein" Exit Sub End If If Aufmass > 0 And Vor_Schlicht = 0 Then MsgBox "Vorschub Schlichten kann nicht Null sein" Exit Sub End If If Schrittiefe = 0 Then MsgBox "Schritttiefe kann nicht Null sein" Exit Sub End If If Schrittiefe > Endtiefe Then MsgBox "Schritttiefe kann nicht grer Endtiefe sein" Exit Sub End If If Aufmass > 0 And Aufmass > Durchmesser / 10 Then MsgBox "Schlichtaufmass zu gro" Exit Sub End If Endtiefe = Endtiefe * -1 Schrittiefe = Schrittiefe * -1 OpenTeachFile "Kreistasche.tap" Code "G0 G21 G49 G40 G17 G80 G50 G90 " If Wechsel = 1 Then Code"M6 T0"& "(Schruppfrser " & Durchmesser & ")" Else Code"M6 T0"& "(Frser " & Durchmesser & ")" End If Code"M03 S" & U_Schrupp If Schwall = 1 Then Code"M08" End If If Nebel = 1 Then Code"M07" End If NC = 1 Radius = 0 Ueberlappung = Ueberlappung/100*Durchmesser Durchgang = 1 RadiusWerkzeug = Durchmesser / 2 RadiusTasche = (Tasche / 2) - RadiusWerkzeug - Aufmass Abfahrt = Durchmesser * 3 / 10 If Abfahrt > (RadiusTasche - Aufmass) Then Abfahrt = RadiusTasche - Aufmass End If Zaehler = 1 Code "G00 Z" & Sicher_Z LetzteTiefe = 0 Do TiefeDurchgang = NC * Schrittiefe If TiefeDurchgang < Endtiefe Then TiefeDurchgang = Endtiefe End If Code "X" & X_Pos & " Y" & Y_Pos NC1 = 0 Radius = Ueberlappung Do If RadiusTasche < Ueberlappung Then Exit Do End If Endpunkt_X = nFmt(X_Pos + Radius, 4) Schnittradius = nFmt(Radius - Ueberlappung / 2, 4) If NC1 = 0 Then Code "G00 Z" & 0.1 - LetzteTiefe Code "G02 Y" & Y_Pos & " X" & Endpunkt_X & " Z" & nFmt(TiefeDurchgang, 4) & " F" & Vor_Z & " R" & Schnittradius Code "G03 X" & X_Pos & " Y" & Y_Pos & " R" & Schnittradius & " F" & Vor_Schrupp Code "G02 Y" & Y_Pos & " X" & Endpunkt_X & " R" & Schnittradius Else Code "G02 Y" & Y_Pos & " X" & Endpunkt_X & " R" & Schnittradius End If NC1 = 1 Endpunkt_X = nFmt( X_Pos - Radius, 4) Radius = nFmt(Radius, 4) Code"G02 Y" & Y_Pos & " X" & Endpunkt_X & " R" & Radius Radius = Radius + Ueberlappung If RadiusTasche <= Radius Then Schnittradius = nFmt((Abs(X_Pos - Endpunkt_X) + RadiusTasche ) / 2, 4) Code "G02 Y" & Y_Pos & " X" & X_Pos + RadiusTasche & " R" & Schnittradius Code "G02 Y" & Y_Pos & " X" & X_Pos - RadiusTasche & " R" & RadiusTasche Code "G02 X" & X_Pos + RadiusTasche & " Y" & Y_Pos & " R" & RadiusTasche Exit Do End If Loop While RadiusTasche >= Radius If RadiusTasche < Ueberlappung Then Code "G00 Z" & 0.1 - LetzteTiefe Code "G02 Y" & Y_Pos & " X" & X_Pos + RadiusTasche & " Z" & nFmt(TiefeDurchgang, 4) & " F" & Vor_Z & " R" & RadiusTasche / 2 Code "G02 Y" & Y_Pos & " X" & X_Pos - RadiusTasche & " R" & RadiusTasche Code "G02 X" & X_Pos + RadiusTasche & " Y" & Y_Pos & " R" & RadiusTasche End If If Abfahrt > 0 Then If RadiusTasche > Abfahrt Then Code "G02 Y" & Y_Pos - Abfahrt & " X" & X_Pos + RadiusTasche - Abfahrt & " R" & Abfahrt Else Code "G02 Y" & Y_Pos - RadiusTasche / 2 & " X" & X_Pos + RadiusTasche - RadiusTasche / 2 & " R" & RadiusTasche / 2 End If End If Code "G00 Z" & Sicher_Z NC = NC + 1 Radius = 0 LetzteTiefe = LetzteTiefe - Schrittiefe Loop While TiefeDurchgang > Endtiefe If Aufmass > 0 Then RadiusTasche = (Tasche / 2) - RadiusWerkzeug Abfahrt = Durchmesser * 3 / 10 If Abfahrt > RadiusTasche Then Abfahrt = RadiusTasche End If If Wechsel = 1 Then Code "M09" Code "M6 T0"& "(Schlichtfrser " & Durchmesser & ")" Code "M03 S" & U_Schlicht If Schwall = 1 Then Code"M08" End If If Nebel = 1 Then Code"M07" End If End If Do If Abfahrt > 0 Then If RadiusTasche > Abfahrt Then Code "G00 Y" & Y_Pos - Abfahrt & " X" & X_Pos + RadiusTasche - Abfahrt Code "G00 Z" & Endtiefe Code "G03 Y" & Y_Pos & " X" & X_Pos + RadiusTasche & " R" & Abfahrt Else Code "G00 Y" & Y_Pos - RadiusTasche / 2 & " X" & X_Pos + RadiusTasche / 2 Code "G00 Z" & Endtiefe Code "G03 Y" & Y_Pos & " X" & X_Pos + RadiusTasche & " R" & RadiusTasche / 2 End If End If Code "G03 Y" & Y_Pos & " X" & X_Pos - RadiusTasche & " R" & RadiusTasche Code "G03 Y" & Y_Pos & " X" & X_Pos + RadiusTasche & " R" & RadiusTasche If Abfahrt > 0 Then If RadiusTasche > Abfahrt Then Code "G03 Y" & Y_Pos + Abfahrt & " X" & X_Pos + RadiusTasche - Abfahrt & " R" & Abfahrt Else Code "G03 Y" & Y_Pos + RadiusTasche / 2 & " X" & X_Pos + RadiusTasche - RadiusTasche / 2 & " R" & RadiusTasche / 2 End If End If Code "G00 Z" & Sicher_Z AnzahlSchlicht = AnzahlSchlicht -1 Loop While AnzahlSchlicht > 0 End If Code"M5 M9" Code"M30" CloseTeachFile Call LoadTeachFile() DoOEMButton(1) End Sub NoneNone%+.4f$B"NoneXIf GetUserLED(1252) = 0 Then SetUserLED((1252),1) Else SetUserLED((1252),0) End If NoneNone%+.4f9?X"NoneXIf GetUserLED(1251) = 0 Then SetUserLED((1251),1) Else SetUserLED((1251),0) End If NoneNone%+.4f8";"NoneXIf GetUserLED(1250) = 0 Then SetUserLED((1250),1) Else SetUserLED((1250),0) End If NoneNone%+.4f88NoneNone NoneNone%+.4f@Y8NoneNone NoneNone%+.4f";8NoneNone NoneNone%+.4f NoneNone NoneNone2%.0f NoneNone NoneNone1%.0f NoneNone NoneNone0%.0f NoneNone NoneNone/%.0f NoneNone NoneNone.%.0fn NoneNone NoneNone-%.0fUi NoneNone NoneNone(%+.3fD1 NoneNone NoneNone'%+.3fD NoneNone NoneNone3%.3f NoneNone NoneNone,%.3f#7 NoneNone NoneNone)%.3f& NoneNone NoneNone*%.3fe  NoneNone NoneNone+%.3fr NoneNone NoneNone&%.3f6wJNoneNone ,autom. Kantenfinder Bitmaps\Bildschirm19.bmpLabel%+.4fL"NoneSub Main() X_Pos = GetOEMDRO(1078) Y_Pos = GetOEMDRO(1079) Laenge = GetOEMDRO(1082) Breite = GetOEMDRO(1083) Endtiefe = GetOEMDRO(1080) Schrittiefe = GetOEMDRO(1077) Durchmesser = GetOEMDRO(1084) Aufmass = GetOEMDRO(1081) Sicher_Z = GetOEMDRO(1092) Ueberlappung = GetOEMDRO(1085) Vor_Schrupp = GetOEMDRO(1086) Vor_Schlicht = GetOEMDRO(1087) Vor_Z = GetOEMDRO(1088) U_Schrupp = GetOEMDRO(1089) U_Schlicht = GetOEMDRO(1090) AnzahlSchlicht = GetOEMDRO(1091) If GetUserLED(1253) = 1 Then Schwall = 1 Else Schwall = 0 End If If GetUserLED(1254) = 1 Then Nebel = 1 Else Nebel = 0 End If If GetUserLED(1232) = 1 Then Wechsel = 1 Else Wechsel = 0 End If If Laenge + Aufmass * 2 <= Durchmesser Then MsgBox "Werkzeugdurchmesser zu gro" Exit Sub End If If Breite + Aufmass * 2 <= Durchmesser Then MsgBox "Werkzeugdurchmesser zu gro" Exit Sub End If If Durchmesser = 0 Then MsgBox "Werkzeugdurchmesser darf nich Null sein" Exit Sub End If If Laenge = 0 Then MsgBox "Lnge kann nicht Null sein" Exit Sub End If If Breite = 0 Then MsgBox "Breite kann nicht Null sein" Exit Sub End If If Ueberlappung = 0 Then MsgBox "berlappung kann nicht NUll sein" Exit Sub End If If Ueberlappung > 95 Then MsgBox "berlappung kann nicht grer als 95% sein" Exit Sub End If Ueberlappung = 100 - Ueberlappung If Vor_Schrupp = 0 Then MsgBox "Vorschub Schruppen kann nicht Null sein" Exit Sub End If If Vor_Z = 0 Then MsgBox "Vorschub Eintauchen kann nicht Null sein" Exit Sub End If If Aufmass > 0 And Vor_Schlicht = 0 Then MsgBox "Vorschub Schlichten kann nicht Null sein" Exit Sub End If If Schrittiefe = 0 Then MsgBox "Schritttiefe kann nicht Null sein" Exit Sub End If If Schrittiefe > Endtiefe Then MsgBox "Schritttiefe kann nicht grer Endtiefe sein" Exit Sub End If OpenTeachFile "Rechtecktasche.tap" Code "G0 G21 G49 G40 G17 G80 G50 G90 " If Wechsel = 1 Then Code"M6 T0"& "(Schruppfrser " & Durchmesser & ")" Else Code"M6 T0"& "(Frser " & Durchmesser & ")" End If Code"M03 S" & U_Schrupp If Schwall = 1 Then Code"M08" End If If Nebel = 1 Then code "M07" End If Durchgang = 1 Schrittiefe = Schrittiefe * -1 Endtiefe = Endtiefe * -1 LetzteTiefe = 0 Ueberlappung = (Abs(Ueberlappung)) / 100 * Durchmesser Werkzeugradius = Durchmesser / 2 WerkzeugradiusSchrupp = Werkzeugradius + Aufmass Abfahrt = Durchmesser * 3 / 10 Zaehler = 1 Code "G00 Z" & Sicher_Z Do TiefeDurchgang = (Durchgang * Schrittiefe) If TiefeDurchgang < Endtiefe Then TiefeDurchgang = Endtiefe End If If Laenge >= Breite Then VonX = X_Pos + Breite / 2 NachX = X_Pos + Laenge - Breite / 2 Rampe = Abs(TiefeDurchgang + LetzteTiefe) * 1.5 If NachX - VonX < Rampe Then Rampe = NachX - VonX End If Code "G00 X" & nFmt(VonX,4) & " Y" & nFmt(Y_Pos + Breite / 2, 4) Code "G00 Z" & 0.1 - LetzteTiefe Code "G01 X" & nFmt(VonX + Rampe, 4) & " Z" & TiefeDurchgang &" F" & Vor_Z Code "X" & nFmt(VonX, 4) & " F" & Vor_Schrupp Code "X" & nFmt(NachX, 4) Schnittweite = Breite / 2 Else VonY = Y_Pos + Breite - Laenge / 2 NachY = Y_Pos + Laenge / 2 Rampe = Abs(TiefeDurchgang + LetzteTiefe) * 1.5 If VonY - NachY < Rampe Then Rampe = VonY - NachY End If Code "G00 X" & nFmt(X_Pos + Laenge / 2, 4) & " Y" & nFmt(VonY, 4) Code "G00 Z" & 0.1 - LetzteTiefe Code "G01 Y" & nFmt(VonY - Rampe, 4) & " Z" & TiefeDurchgang &" F" & Vor_Z Code "Y" & nFmt(VonY, 4) & " F" & Vor_Schrupp Code "Y" & nFmt(NachY, 4) Schnittweite = Laenge / 2 End If LetzteTiefe = LetzteTiefe - Schrittiefe Call SchruppGegenlauf(X_Pos, Y_Pos, Laenge, Breite, Ueberlappung, WerkzeugradiusSchrupp, Schnittweite) CODE "G00 Z" & Sicher_Z Durchgang = Durchgang + 1 Loop While TiefeDurchgang > Endtiefe If Aufmass<> 0 Then If Wechsel = 1 Then Code"M6 T0"& "(Schlichtfrser " & Durchmesser & ")" End If Do Call SchlichtenGleichlauf(X_Pos,Y_Pos,Laenge,Breite,Endtiefe,Werkzeugradius,Aufmass,Vor_Z,Vor_Schrupp,Vor_Schlicht,Abfahrt) AnzahlSchlicht = AnzahlSchlicht - 1 Loop While AnzahlSchlicht > 0 End If CODE "G00 Z" & Sicher_Z Code"M5 M9" Code"M30" CloseTeachFile Call LoadTeachFile() DoOEMButton(1) End Sub Sub SchlichtenGleichlauf(X_Pos,Y_Pos,Laenge,Breite,Endtiefe,Werkzeugradius,Aufmass,Vor_Z,Vor_Schrupp,Vor_Schlicht,Abfahrt) If Abfahrt > 0 And Laenge > (Abfahrt * 2 + Werkzeugradius * 2 + 0.2) And Breite > (Abfahrt *2 + Werkzeugradius * 2 + 0.2) Then Code "G00 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite - Abfahrt * 2 - Werkzeugradius Code "G00 Z" & Endtiefe Code "F" & Vor_Schlicht Code "G03 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite - Werkzeugradius & " R" & Abfahrt Code "G01" Code "X" & X_Pos + Werkzeugradius Code "Y" & Y_Pos + Werkzeugradius Code "X" & X_Pos + Laenge - Werkzeugradius Code "Y" & Y_Pos + Breite - Werkzeugradius Code "X" & X_Pos + Laenge / 2 Code "G03 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite - Abfahrt * 2 - Werkzeugradius & " R" & Abfahrt Else Code "G00 X" & X_Pos + Laenge / 2 & " Y" & Y_Pos + Breite - Werkzeugradius Code "G00 Z" & Endtiefe Code "F" & Vor_Schlicht Code "G01" Code "X" & X_Pos + Werkzeugradius Code "Y" & Y_Pos + Werkzeugradius Code "X" & X_Pos + Laenge - Werkzeugradius Code "Y" & Y_Pos + Breite - Werkzeugradius Code "X" & X_Pos + Laenge / 2 End If End Sub Sub SchruppGegenlauf(XStart,YStart,Laenge,Breite,Ueberlappung,Werkzeugradius,Schnittweite) Durchgang=1 Do X_Pos1 = nFmt(Xstart + Laenge - Schnittweite + Ueberlappung * Durchgang, 4) Y_Pos1 = nFmt(Ystart + Schnittweite - Ueberlappung * Durchgang, 4) X_Pos2 = nFmt(Xstart + Schnittweite - Ueberlappung * Durchgang, 4) Y_Pos2 = nFmt(Ystart + Breite - Schnittweite + Ueberlappung * Durchgang, 4) If X_Pos1 > Xstart + Laenge - Werkzeugradius Then X_Pos1 = nFmt(Xstart + Laenge - Werkzeugradius, 4) Y_Pos1 = nFmt(Ystart + Werkzeugradius, 4) X_Pos2 = nFmt(Xstart + Werkzeugradius, 4) Y_Pos2 = nFmt(Ystart + Breite - Werkzeugradius, 4) Durchgang=0 End If Code "X" & X_Pos1 & " Y" & Y_Pos1 Code "X" & X_Pos2 Code "Y" & Y_Pos2 Code "X" & X_Pos1 Code "Y" & Y_Pos1 If Durchgang = 0 Then Exit Sub End If Durchgang=Durchgang+1 Loop While Durchgang<20000 End Sub Main NoneNone%+.4f$B"NoneYIf GetUserLED(1232) = 0 Then SetUserLED((1232),1) Else SetUserLED((1232),0) End If NoneNone%+.4f8@Y"NoneYIf GetUserLED(1254) = 0 Then SetUserLED((1254),1) Else SetUserLED((1254),0) End If NoneNone%+.4f8";"NoneYIf GetUserLED(1253) = 0 Then SetUserLED((1253),1) Else SetUserLED((1253),0) End If NoneNone%+.4f88NoneNone NoneNone%+.4f@Y8NoneNone NoneNone%+.4f";8NoneNone NoneNone%+.4f NoneNone NoneNoneC%.0f NoneNone NoneNoneB%.0f NoneNone NoneNoneA%.0f NoneNone NoneNone@%.0f NoneNone NoneNone?%.0fn NoneNone NoneNone>%.0fUi NoneNone NoneNone=%.0f<P NoneNone NoneNone7%+.3f NoneNone NoneNone6%+.3f NoneNone NoneNone<%0.3f#7 NoneNone NoneNoneD%0.3f NoneNone NoneNone9%0.3fG- NoneNone NoneNone8%0.3f' NoneNone NoneNone5%0.3f@tT NoneNone NoneNone:%0.3f NoneNone NoneNone;%0.3f"NoneDoOEMButton(1024) While ismoving() Sleep 100 Wend DoOEMButton(1022) While ismoving() Sleep 100 Wend DoOEMButton(1023) While ismoving() Sleep 100 Wend NoneLabell%+.4f@YNoneNone None%+.4fAd8 NoneNone NoneLabel%+.4f/8 NoneNone NoneLabel%+.4f/" NonePIf GetUserLED(1003) = 0 Then SetUserLED(1003, 1) SetUserLED(1004, 0) End If NoneLabel%+.4f" NonePIf GetUserLED(1004) = 0 Then SetUserLED(1004, 1) SetUserLED(1003, 0) End If NoneLabel%+.4f NoneNone NoneLabel%+.3ff NoneNone NoneLabel%+.4ff  NoneNone NoneLabel%+.4ffNoneNone NoneLabel%+.4fy\"NoneIf GetOEMLED(1090) Then If Not GetOEMLED(1091) Then SetUserLED (1091, 1) Else SetUserLED (1091, 0) End If End If NoneLabel%+.4f0,E8NoneNone NoneNoneC%+.4f0/:E 2NoneNone None6%+.4f0zS None NoneLabelg%+.4f9C None NoneLabelg%+.4fE6P> NoneNone NoneLabelg%+.4f1 9  NoneNone NoneLabelg%+.4f 2NoneNone NoneLabelg%+.4fdJoSNoneNone NoneSichere Z-Hhe%+.4f6  NoneNone NoneNonep%+.2f (" Hilfe;HtmlDialog( GetMainFolder()+"Edge-Finder_Options.htm" ) NoneHelp%+.4fr8 NoneNone NoneNone9%+.4f" automatische Messungv Rem HiddenScript.m1s (2022/03/17) Rem Deutscher Textbeitrag aus Winfried Kenter Rem programming #7, #16, #17, #27, #37, 100-833 Rem VBScript To center probe inside the edge-finder hole, And On Any edge rem Vancura Innovations 2006/10/30 creation Date; (copyright 2006 - 2022) rem 9010 33rd ST W rem Rock Island, IL 61201 rem (309) 235-1069 rem edgefinder@vancura.biz rem CAUTION: Do Not change Any Line marked With Dim Or REM! rem NOTE: User changable parameters start at Line 105 rem revisions: rem 2020/06/05: Fcn 8 add large hole ZXY rem 2020/05/09: patch To fcn 8 rem 2019/10/18: More Speedy fixup Fcn 7 incorporated Fcn17 & 27 Rem 2019/09/20: Added speedy FCN-17 & FCN-27 setup Rem 2019/09/05: Fixed Z operation On Fcn 7 Rem 2019/06/12: Put feed rate On same Line As G0 And G31 commands; Fixed fcn 6 three Read Rem 2019/06/15: major Mod To Seek edges ' Option Explicit ' this forces programmer to list all variables ' Dim tool_1 As Double ' Favorite tool #1 size Dim tool_2 As Double ' Favorite tool #2 size Dim tool_3 As Double ' Favorite tool #3 size Dim SIDE_X As Double ' finder side width X Dim SIDE_Y As Double ' finder side width Y Dim CENTER_X As Double ' Center of hole offset X Dim CENTER_Y As Double ' Center of hole offset Y Dim CNTR_2_X As Double ' Center of hole offset X Dim CNTR_2_Y As Double ' Center of hole offset Y Dim Z_TOP1 As Double ' Top of edgefinder #1 to workpiece surface Dim Z_TOP2 As Double ' Top of edgefinder #2 to workpiece surface Dim BigMove As Double ' about 1" (25.4mm) move probe this distance looking for edge Dim SmallMove As Double ' about 0.100" (2.54mm) clearance over material Dim FeedSlow As Double ' 4in/min or 100mm/min; Faster sacrifices accuracy, slower increases boredom Dim FeedFast As Double ' 10 x FeedSlow Faster sacrifices accuracy, slower increases boredom Dim safeZ As Double ' === change safe Z height; should clear work-piece ' ==================================================== Dim toolsize As Double ' tool diameter Dim touchoffsetX As Double ' tool + side thickness Dim touchoffsetY As Double ' tool + side thickness Dim FeedCurrent As Double ' feed speed being used Dim Xoffset As Double ' position information Dim Yoffset As Double ' position information Dim XCurrent As Double ' position information Dim YCurrent As Double ' position information Dim ZCurrent As Double ' position information Dim XCenter As Double ' calculated center Dim YCenter As Double ' calculated center Dim ZTOP As Double Dim ZTOP_GOAL As Double ' Desired setting after touch off Dim XNew As Double ' destination of next move Dim YNew As Double ' destination of next move Dim ZNew As Double ' destination of next move Dim XPos1 As Double ' saved temp position Dim YPos1 As Double ' saved temp position Dim ZPos1 As Double ' saved temp position Dim XPos2 As Double ' saved temp position Dim YPos2 As Double ' saved temp position Dim ZPos2 As Double ' saved temp position Dim XAvg As Double ' saved temp value Dim YAvg As Double ' saved temp value Dim ZAvg As Double ' saved temp value Dim XSave As Double ' saved temp value Dim YSave As Double ' saved temp value Dim ZSave As Double ' saved temp value Dim Temp As Double Dim SpeedSetup17_tool As Double Dim SpeedSetup17_finderX As Double Dim SpeedSetup17_finderY As Double Dim SpeedSetup17_top As Double Dim SpeedSetup27_tool As Double Dim SpeedSetup27_finderX As Double Dim SpeedSetup27_finderY As Double Dim SpeedSetup27_top As Double Dim max_error As Double ' allowed max error for a good reading Dim UnitsMode As Double ' 0- Metric, 1 = Inch Dim TopFlag As Double ' 0=Finder 1= Workpiece Dim mymode As Double ' selection: for action; answer to question Dim mytoolsize As Double ' Answer to question Dim myanswer As Double ' Answer to question Dim mySide As Double ' Answer to question Dim toolSelected As Double Dim HoleSelected As Double Dim DefaultTool As Double Dim DefaultHeight As Double Dim DefaultSideX As Double Dim DefaultSideY As Double Dim DefaultHoleX As Double Dim DefaultHoleY As Double Dim Zsel As Double Dim cmd1 As Integer Dim cmd2 As Integer Dim cmd3 As Integer Dim cmd4 As Integer ' Dim RetryLimit As Integer ' Loop retry limit Dim LoopCount As Integer ' Loop retry limit Dim xstr As String Dim unit_x As String ' ' ================================================================= ' ===== CODE STARTS HERE ========================================= ' ================================================================= ' Sub Main ' xstr = " This is a test string." ' Quest(xstr) code "G17 G40 G50 G54 G90 G94" ' === remove all Mach3 flags === code "G52 X0.0 Y0.0 Z0.0" UnitsMode = 7 ' === Dummy value to detect a read error === UnitsMode = GetParam("Units") ' === Determine if Metric (0) or English (1) mode RetryLimit = 3 ' === Loop Retry limit === ' If UnitsMode = 0 Then ' === Set Metric Parameters === ' ======================================================= ' ====== CHANGE HERE to set METRIC mode parameters ====== ' ======================================================= Code "(Operating in mm mode.)" tool_1 = 2.00 ' = 2.00mm Favorite tool #1 size tool_2 = 3.00 ' = 3.00mm Favorite tool #2 size tool_3 = 5.00 ' = 5.00mm Favorite tool #3 size SIDE_X = 7.720 ' 0.300" = 7.720mm finder side width both X SIDE_Y = 7.720 ' 0.300" = 7.720mm finder side width both Y CENTER_X = 00.000 ' mm Center of hole offset X CENTER_Y = 00.000 ' mm Center of hole offset Y CNTR_2_X = 12.7 ' mm Center of large hole X CNTR_2_Y = 12.7 ' mm Center of large hole Y Z_TOP1 = 3.81 ' mm Top of edgefinder to workpiece surface Z_TOP2 = 6.35 ' mm Top of edgefinder to workpiece surface BigMove = 24.0 ' mm move probe this distance looking for edge SmallMove = 2.54 ' 0.100" = 2.540mm clearance over material FeedSlow = 100 ' 4in/min or 100mm/min Faster sacrifices accuracy, slower max_error = 0.025 ' 0.001" = 0.025mm unit_x = "mm" ' unit type ' ElseIf UnitsMode = 1 Then ' === set INCH mode parameters === ' ======================================================= ' ======= CHANGE HERE to set INCH mode parameters ======= ' ======================================================= Code "(Operating in INCH mode.)" tool_1 = 0.0937 ' 3/32" = 2.380mm Favorite tool #1 size tool_2 = 1/8 ' 1/8" = 3.175mm Favorite tool #2 size tool_3 = 1/4 ' 1/4" = 6.350mm Favorite tool #3 size SIDE_X = 0.300 ' 0.300" = 7.720mm finder side width both X SIDE_Y = 0.300 ' 0.300" = 7.720mm finder side width both Y CENTER_X = 0.000 ' inches Center hole offset X CENTER_Y = 0.000 ' inches Center hole offset Y CNTR_2_X = 0.500 ' inches Center of large hole X CNTR_2_Y = 0.500 ' inches Center of large hole Y Z_TOP1 = 0.150 ' inches Top of edgefinder to workpiece surface Z_TOP2 = 0.250 ' inches Top of edgefinder to workpiece surface BigMove = 1.000 ' 1.000" = 25.400mm move probe this distance looking for edge SmallMove = 0.100 ' 0.100" = 2.540mm clearance over material FeedSlow = 4.000 ' 4in/min or 100mm/min Faster sacrifices accuracy, slower max_error = 0.001 ' 0.001" = 0.025mm unit_x = "in" ' unit type ' Else Code "(Major Error: Cannot determine if INCH or MM mode.)" Exit Sub ' === if system mode is not zero or one then quit === End If ' ================================================================= While IsMoving() 'Force a display update to show mm/INCH mode Sleep(1) 'Sleep give other processes time to run Wend 'An empty while/wend loop takes almost 100% of computer time ' ' === M Y D E F A U L T I T E M S === DefaultTool = tool_2 DefaultHeight = Z_TOP1 DefaultSideX = SIDE_X DefaultSideY = SIDE_Y HoleSelected = 1 ' 1=Small 2=large hole; (all else)=default DefaultHoleX = CENTER_X DefaultHoleY = CENTER_Y ' ' # 7 & 17 Without finder SpeedSetup17_tool = tool_2 ' speedy setup selector fcn-17 SpeedSetup17_finderX = 0.0 ' speedy setup selector fcn-17 SpeedSetup17_finderY = 0.0 ' speedy setup selector fcn-17 SpeedSetup17_top = 0.0 ' speedy setup selector fcn-17 ' # 7 & 27 With finder SpeedSetup27_tool = tool_2 ' speedy setup selector fcn-27 SpeedSetup27_finderX = SIDE_X ' speedy setup selector fcn-27 SpeedSetup27_finderY = SIDE_Y ' speedy setup selector fcn-27 SpeedSetup27_top = Z_TOP1 ' speedy setup selector fcn-27 safeZ = SmallMove ' === change safe Z height; should clear work-piece FeedFast = FeedSlow * 10 ' === Faster sacrifices accuracy, slower increases boredom ' =============================================================================== ' === P L E A S E D O N O T C H A N G E C O D E B E L O W H E R E === ' =============================================================================== rem rem === program will Not run If probe is shorted === If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty Code "(Probe is grounded, check clearance and try again)" Else ' === module works in only one mode === If GetOemLed (16) <> 0 Then 'Warning Wrong Coordinate system DoOEMButton(107) Code "(Changing to Normal DRO Mode)" Code "G4 P0.25" ' === Pause 1/4 sec === End If DoSpinStop ' === double check motor is not running === Xoffset = SmallMove Yoffset = SmallMove toolsize = (tool_2)/2 ' === 1/8" tool default tool size === ' === ask user to select an operation to perform. === 'mymode = Question ("0=Q 1,8=CTR 2=XL 3=YL 4=XH 5=YH 6=Z 7=XYZ") mymode = Question ("Funktion#, 0 fr Ende oder 999 fr HILFE.") ' Character count 1 ^10 ^20 ^30 ^40 ' If mymode = 0 Then ' === zero quits without doing anything === Code "(0 = Quit)" Exit Sub End If ' === ask more questions if not finding center or Z=0 === If ((mymode = 1) Or (mymode = 8) Or (mymode = 11)) Then ' === do nothing here === ElseIf mymode = 6 Or mymode = 16 Then ' mytoolsize = Question ("Oberer Offset: 0=Ende; 1=" & Z_TOP1 &"; 2="& Z_TOP2 &"; 3=Mehr") ' Finder thickness ' If mytoolsize = 0 Then ZTOP_GOAL = 0 ' Find Workpiece Top' ElseIf mytoolsize = 1 Then ZTOP_GOAL = Z_TOP1 ' Find edge finder 1 Top' ElseIf mytoolsize = 2 Then ZTOP_GOAL = Z_TOP2 ' Find edge finder 2 Top' ElseIf mytoolsize = 3 Then ' More Options myanswer = Question ("FinderOffset: 0=Ende") If (myanswer <=0) Then Exit Sub Else ZTOP_GOAL = (myanswer) End If Else Exit Sub ' QUIT allow only 1, 2, & 3 End If ' ElseIf (((mymode >= 2) And (mymode < 7)) Or (mymode = 12) Or (mymode = 13) Or (mymode = 14) Or (mymode = 15)) Then mytoolsize = Question (" Sonde: 0=Ende; 1="& tool_1 & unit_x & "; 2=" & tool_2 & unit_x & "; 3=Mehr") If (mytoolsize = 1) Then toolsize = (tool_1) /2 ElseIf (mytoolsize = 2) Then toolsize = (tool_2) /2 ElseIf (mytoolsize = 3) Then myanswer = Question ("Eingabe Sonde: 0=Ende") If (myanswer <=0) Then Exit Sub Else toolsize = (myanswer) /2 End If Else 'If (mytoolsize <= 0) Then Exit Sub End If ' mySide = Question ("Kantenoffset: 0=Ende 1=Kantenfinder 2=kein") ' Character count 1 ^10 ^20 ^30 ^40 If mySide = 2 Then touchoffsetX = toolsize ' Touch to work_piece touchoffsetY = toolsize ' Touch to work_piece Code "(Using Offset for Work Piece)" ElseIf mySide = 1 Then touchoffsetX = toolsize + SIDE_X ' Touch to edgefinder touchoffsetY = toolsize + SIDE_Y ' Touch to edgefinder Code "(Using Offset for Edge Finder)" Else Exit Sub End If ElseIf (mymode = 7) Then myanswer = Question ("1=Kantenfinder, 2=Werkstck, 3=Manuel") If (myanswer = 2) Then ' To the work piece touchoffsetX = SpeedSetup17_tool/2 + SpeedSetup17_finderX ' Touch to edgefinder touchoffsetY = SpeedSetup17_tool/2 + SpeedSetup17_finderY ' Touch to edgefinder ZTOP_GOAL = SpeedSetup17_top myanswer = Question ("Fertig? 0=NEIN 1-2=JA") If myanswer <= 0 Then Exit Sub ElseIf (myanswer =1) Then ' To the Edge finder touchoffsetX = SpeedSetup27_tool/2 + SpeedSetup27_finderX ' Touch to edgefinder touchoffsetY = SpeedSetup27_tool/2 + SpeedSetup27_finderY ' Touch to edgefinder ZTOP_GOAL = SpeedSetup27_top myanswer = Question ("Fertig? 0=NEIN 1-2=JA") If myanswer <= 0 Then Exit Sub ElseIf (myanswer = 3) Then ' Custom setup mytoolsize = Question (" Sonde: 0=Ende; 1="& tool_1 & unit_x & "; 2=" & tool_2 & unit_x & "; 4=Mehr") If (mytoolsize = 1) Then toolsize = (tool_1) /2 ElseIf (mytoolsize = 2) Then toolsize = (tool_2) /2 ElseIf (mytoolsize = 3) Then toolsize = (tool_3) /2 ElseIf (mytoolsize = 4) Then myanswer = Question ("Eingabe Sonde: 0=Ende") If (myanswer <=0) Then Exit Sub Else toolsize = (myanswer) /2 End If Else 'If (mytoolsize <= 0) Then Exit Sub End If mytoolsize = Question ("Offset oben: 0=Ende; 1=" & Z_TOP1 &"; 2="& Z_TOP2 &"; 3=Mehr") ' Finder thickness ' If mytoolsize = 0 Then ZTOP_GOAL = 0 ' Find Workpiece Top' ElseIf mytoolsize = 1 Then ZTOP_GOAL = Z_TOP1 ' Find edge finder 1 Top' ElseIf mytoolsize = 2 Then ZTOP_GOAL = Z_TOP2 ' Find edge finder 2 Top' ElseIf mytoolsize = 3 Then ' More Options myanswer = Question ("Sondendicke: 0=Ende") If (myanswer <=0) Then Exit Sub Else ZTOP_GOAL = (myanswer) End If Else Exit Sub ' QUIT allow only 1, 2, & 3 End If Else Exit Sub End If ElseIf mymode = 8 Then ' === XYZ with center hole === touchoffsetX = DefaultTool + SIDE_X ' Touch to edgefinder touchoffsetY = DefaultTool + SIDE_Y ' Touch to edgefinder ZTOP_GOAL = Z_TOP1 ElseIf (mymode = 81 Or mymode = 80) Then ' === XYZ with center hole === touchoffsetX = DefaultTool + SIDE_X ' Touch to edgefinder touchoffsetY = DefaultTool + SIDE_Y ' Touch to edgefinder ZTOP_GOAL = Z_TOP1 mymode = 8 ElseIf (mymode = 17) Then ' === Without EdgeFinder === touchoffsetX = SpeedSetup17_tool/2 + SpeedSetup17_finderX ' Touch to Surface touchoffsetY = SpeedSetup17_tool/2 + SpeedSetup17_finderY ' Touch to Surface ZTOP_GOAL = SpeedSetup17_top ElseIf (mymode = 27 Or mymode = 37) Then touchoffsetX = SpeedSetup27_tool/2 + SpeedSetup27_finderX ' Touch to edgefinder touchoffsetY = SpeedSetup27_tool/2 + SpeedSetup27_finderY ' Touch to edgefinder ZTOP_GOAL = SpeedSetup27_top ElseIf (Int(mymode/100) <= 0) Or (mymode > 1000) Then Exit Sub Else cmd1 = Int(mymode/100) cmd2 = Int((mymode - cmd1*100)/10) cmd3 = mymode - cmd1*100 - cmd2*10 End If ' FeedCurrent = GetOemDRO(818) 'Get the current settings code "G52 X0 Y0 Z0" XCurrent = GetOEMDRO(800) ' location of tool X position YCurrent = GetOEMDRO(801) ' location of tool Y position ZCurrent = GetOEMDRO(802) ' location of tool Z position Code "G4 P1" 'Pause 1 second to give time to position probe plate '======================================== If (cmd1 > 0) And (cmd1 < 9) Then Go_Mode_100 ' returns with cmd1 End If '=========================================== If (mymode = 1 Or mymode = 11 Or cmd1 = 1) Then ' === FIND CENTER OF HOLE) === ' If (mymode = 1 Or mymode = 8 Or mymode = 11 Or cmd1 = 1) Then ' === FIND CENTER OF HOLE) === Go_Mode_1 '=================================== ElseIf ((mymode = 2) Or (mymode = 12) Or (cmd1 = 2)) Then '=================================== Go_Mode_2 '=================================== ElseIf ((mymode = 3) Or (mymode = 13) Or (cmd1 = 3)) Then Go_Mode_3 '=================================== ElseIf ((mymode = 4) Or (mymode = 14) Or (cmd1 = 4)) Then Go_Mode_4 '=================================== ElseIf ((mymode = 5) Or (mymode = 15) Or (cmd1 = 5)) Then Go_Mode_5 '=================================== ElseIf ((mymode = 6) Or (mymode = 16) Or (cmd1 = 6)) Then '==== Z TOP ==== Go_Mode_6 '=================================== ElseIf mymode=7 Or mymode=17 Or mymode=27 Or cmd1= 7 Then '==== X Y Z ==== Go_Mode_7 '=================================== ElseIf mymode = 8 Or mymode = 37 Or cmd1 = 8 Then ' === XYZ with center hole === Go_Mode_8 '=================================== ElseIf cmd1 = 9 Then ' === Help === Go_Mode_9 '=================================== ElseIf mymode = 9 Then ' === Dummy routine === toolsize = (tool_2) /2 '=================================== '=================================== End If '=================================== Rem: === Restore original feedrate === Code "G01 F" &FeedCurrent ' This does not move but does set the Feedrate back to original While IsMoving() 'Wait for stop signal Sleep(1) Wend If(LoopCount > RetryLimit) Then ' see if process timed out Code "(=== DONE === Caution Retry limit was exceeded ===)" Else Code "(=== SUCCESS DONE ===)" End If End If End Sub ' Sub Main() ' ============================ ' === E N D O F M A I N === ' ============================ ' ' ========================================================= ' ========================================================= ' ========= S T A R T O F S U B R O U T I N E S ========= ' ========================================================= ' ========================================================= Sub Go_Mode_1 ' ========================================================= ' ========================================================= If mymode = 1 Then ' text message on screen Code "(Mode 1: Find Hole Center and SET X and Y DROs to zero.)" Else Code "(Mode 8: Find Hole Center and Show Position)" End If Rem Move Probe X Minus XCurrent = GetOEMDRO(800) ' location of tool X position XPos2 = GetOEMDRO(800) ' get the probe start location LoopCount = 0 ' set retry count to zero ' ===== go in X MINUS direction ===== Do XPos1 = XPos2 XNew = Xcurrent - BigMove 'Move probe (1 inch) MINUS Code "G31 X" &XNew & " F" &FeedSlow 'hunt for touch While IsMoving() 'wait for the move to finish Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec XPos2 = GetOEMDRO(800) 'get the probe touch location ' XAvg = (Abs(XPos1 - XPos2)) Temp = (XCurrent + XPos2*4)/5 Code "G01 X" &Temp & " F" &FeedFast 'rapid move back to start point LoopCount = LoopCount + 1 'update loop count Loop Until ((XAvg < max_error) Or (LoopCount > RetryLimit)) XSave = ((XPos1 + XPos2) / 2) ' ' ===== go in X PLUS direction ===== Code "G01 X" &XCurrent & " F" &FeedFast 'rapid move back to start point XPos2 = GetOEMDRO(800) ' get the probe Start location LoopCount = 0 ' set retry count to zero Do XPos1 = XPos2 XNew = Xcurrent + BigMove 'Move probe (1 inch) PLUS Code "G31 X" &XNew & " F" &FeedSlow 'hunt for touch While IsMoving() 'wait for the move to finish Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec XPos2 = GetOEMDRO(800) 'get the probe touch location ' XAvg = Abs(XPos1 - XPos2) Temp = (XCurrent + XPos2*4)/5 Code "G01 X" &Temp & " F" &FeedFast 'rapid move back to start point LoopCount = LoopCount + 1 'update loop count ' Loop Until ((XAvg < max_error) Or (LoopCount > RetryLimit)) ' XCenter = (XSave + ((XPos1 + XPos2) / 2)) / 2 'center is midway between XSave and XPos2 Code "G01 X" &XCenter &" F" &FeedFast 'rapid move to the x center location While IsMoving () 'Wait for stop signal Sleep(1) Wend If (mymode = 1 or cmd1 = 1) Then SetOEMDRO(800,0.000) 'Zero out the location X End If Code "G4 P0.25" 'Pause 1/4 sec ' ====================================== Rem ===== Find Center In Y direction ===== ' ====================================== YCurrent = GetOEMDRO(801) ' location of tool Y position YPos2 = GetOEMDRO(801) ' get the probe start location LoopCount = 0 ' set retry count to zero ' ===== go in Y MINUS direction ===== Do YPos1 = YPos2 ' YNew = Ycurrent - BigMove 'Move probe (1 inch) MINUS Code "G31 Y" &YNew & " F" &FeedSlow 'hunt for touch While IsMoving() 'wait for the move to finish Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec YPos2 = GetOEMDRO(801) 'get the probe touch location ' YAvg = (Abs(YPos1 - YPos2)) Temp = (YCurrent + YPos2*4)/5 Code "G01 Y" &Temp & " F" &FeedFast 'rapid move back to start point LoopCount = LoopCount + 1 'update loop count Loop Until ((YAvg < max_error) Or (LoopCount > RetryLimit)) YSave = ((YPos1 + YPos2) / 2) ' ' ===== go in Y PLUS direction ===== Code "G01 Y" &YCurrent & " F" &FeedFast 'rapid move back to start point YPos2 = GetOEMDRO(801) ' get the probe Start location LoopCount = 0 ' set retry count to zero Do YPos1 = YPos2 YNew = Ycurrent + BigMove 'Move probe (1 inch) PLUS Code "G31 Y" &YNew & " F" &FeedSlow 'hunt for touch While IsMoving() 'wait for the move to finish Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec YPos2 = GetOEMDRO(801) 'get the probe touch location ' YAvg = Abs(YPos1 - YPos2) Temp = (YCurrent + YPos2*4)/5 Code "G01 Y" &Temp & " F" &FeedFast 'rapid move back to start point LoopCount = LoopCount + 1 'update loop count Loop Until ((YAvg < max_error) Or (LoopCount > RetryLimit)) ' YCenter = (YSave + ((YPos1 + YPos2) / 2)) / 2 'center is midway between YSave and YPos2 Code "G01 Y" &YCenter &" F" &FeedFast 'rapid move to the Y center location While IsMoving () 'Wait for stop signal Sleep(1) Wend If (mymode = 1 or cmd1 = 1) Then SetOEMDRO(801,0.000) 'Zero out the location Y End If Code "G4 P0.25" 'Pause 1/4 sec ' Rem ================================================== Rem === Do X center again For better accuracy. ======= Rem ================================================== XCurrent = GetOEMDRO(800) ' location of tool X position XPos2 = GetOEMDRO(800) ' get the probe start location LoopCount = 0 ' set retry count to zero ' ===== go in X MINUS direction ===== Do XPos1 = XPos2 'Latest reading is now older reading XNew = Xcurrent - BigMove 'Move probe (1 inch) MINUS Code "G31 X" &XNew & " F" &FeedSlow 'hunt for touch While IsMoving() 'wait for the move to finish Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec XPos2 = GetOEMDRO(800) 'get the probe touch location ' XAvg = Abs(XPos1 - XPos2) Temp = (XCurrent + XPos2*4)/5 Code "G01 X" &Temp & " F" &FeedFast 'rapid move back to start point LoopCount = LoopCount + 1 'update loop count Loop Until ((XAvg < max_error) Or (LoopCount > RetryLimit)) XSave = ((XPos1 + XPos2) / 2) ' ' ===== go in X PLUS direction ===== Code "G01 X" &XCurrent & " F" &FeedFast 'rapid move back to start point XPos2 = GetOEMDRO(800) ' get the probe Start location LoopCount = 0 ' set retry count to zero Do XPos1 = XPos2 XNew = Xcurrent + BigMove 'Move probe (1 inch) PLUS Code "G31 X" &XNew & " F" &FeedSlow 'hunt for touch While IsMoving() 'wait for the move to finish Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec XPos2 = GetOEMDRO(800) 'get the probe touch location ' XAvg = Abs(XPos1 - XPos2) Temp = (XCurrent + XPos2*4)/5 Code "G01 X" &Temp & " F" &FeedFast 'rapid move back to start point LoopCount = LoopCount + 1 'update loop count Loop Until ((XAvg < max_error) Or (LoopCount > RetryLimit)) ' XCenter = (XSave + ((XPos1 + XPos2) / 2)) / 2 'center is midway between XSave and XPos2 Code "G01 X" &XCenter &" F" &FeedFast 'rapid move to the x center location While IsMoving () 'Wait for stop signal Sleep(1) Wend If (mymode = 1 or cmd1 = 1) Then SetOEMDRO(800,0.000) 'Zero out the location X End If Code "G4 P0.25" 'Small Pause Rem ======================================================= Rem ===== We are done: Center the tool And Do a dance ===== Rem ======================================================= ZPos1 = GetOEMDRO(802) ' get the probe Z location as current ZNew = ZPos1 + safeZ Code "G01 Z" &ZNew ' Pop Up to indicate done While IsMoving () ' Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Small Pause ' Code "G01 Z" &ZPos1 ' Pop back down to indicate done While IsMoving () ' Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Small Pause ZNew = ZPos1 + (BigMove/2) Code "G01 Z" &ZNew ' Pop Up to big indicate done While IsMoving () ' Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Small Pause Code "(=== DONE ===)" End Sub ' ========================================================= ' ========================================================= Sub Go_Mode_2 ' ========================================================= ' ========================================================= Rem === find the outside edge To minus X === If mymode = 2 Then Code "(Mode 2: Find X Left and set X DRO to zero.)" Else Code "(Mode 12: Find X Left and show position.)" End If Rem Move Probe X Plus XPos1 = 0 XCurrent = GetOEMDRO(800) ' location of tool X position LoopCount = 0 ' set count to zero Do XNew = XCurrent + BigMove 'move probe 1 inch to right Code "G31 X" &XNew &" F" &FeedSlow 'Start hunt for edge While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec XPos2 = GetOEMDRO(800) ' Get the X location ' XCenter = (XPos2) + touchoffsetX 'compensate for tool & finder edge Code "G01 X" &(XPos2-safeZ/4) &" F" &FeedFast 'rapid back away from touched surface While IsMoving() 'Wait for stop signal Sleep(1) Wend ' XAvg = Abs(Xpos1 - XCenter) ' do these positions differ XPos1 = XCenter LoopCount = LoopCount + 1 Loop Until((XAvg < max_error)Or(LoopCount > RetryLimit)) ' ZCurrent = GetOEMDRO(802) ' location of tool Z position Code "G01 Z" &(BigMove + ZCurrent)'rapid move to a safe height While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 X" &XCenter &" F" &FeedFast 'rapid move to the x center location While IsMoving () 'Wait for stop signal Sleep(1) Wend If (mymode = 2 or cmd1 = 2) Then SetOEMDRO(800,0.000) 'Zero the X DRO location End If Code "G4 P0.25" 'Pause 1/4 sec ' ===== End Sub ' ' ========================================================= ' ========================================================= Sub Go_Mode_3 ' ========================================================= ' ========================================================= Rem === find the outside edge To minus Y === If mymode = 3 Then Code "(Mode 3: Find Y Low and set Y DRO to zero.)" Else Code "(Mode 13: Find Y Low and show position.)" End If Rem Move Probe Y Plus YPos1 = 0 YCurrent = GetOEMDRO(801) ' location of tool X position LoopCount = 0 ' set count to zero Do YNew = YCurrent + BigMove 'move probe 1 inch to right Code "G31 Y" &YNew &" F" &FeedSlow 'Start hunt for edge While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec YPos2 = GetOEMDRO(801) 'Get the Y location ' YCenter = (YPos2) + touchoffsetY Code "G01 Y" &(YPos2-safeZ/4) &" F" &FeedFast 'rapid move to the x center location While IsMoving() 'Wait for stop signal Sleep(1) Wend ' YAvg = Abs(Ypos1 - YCenter) ' do these positions differ YPos1 = YCenter LoopCount = LoopCount + 1 Loop Until((YAvg < max_error)Or(LoopCount > RetryLimit)) ' ZCurrent = GetOEMDRO(802) ' location of tool X position Code "G01 Z" &(BigMove + ZCurrent)'rapid move to the x center location While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 Y" &YCenter &" F" &FeedFast 'rapid move to the x center location While IsMoving () 'Wait for stop signal Sleep(1) Wend If (mymode = 3 or cmd1 = 3) Then SetOEMDRO(801,0.000) 'Zero the Y DRO position End If Code "G4 P0.25" 'Pause 1/4 sec ' ===== End Sub ' ========================================================= ' ========================================================= Sub Go_Mode_4 ' ========================================================= ' ========================================================= Rem === find the outside edge To plus X === If mymode = 14 Then Code "(Mode 14: Find Y Max and set Y=0.0.)" Else Code "(Mode 4: Find Y Max and Show location)" End If Rem Move Probe X Minus (Move the probe In the X minus direction Until touch) XPos1 = 0 ' assume last position was zero XCurrent = GetOEMDRO(800) ' location of tool X position LoopCount = 0 ' set count to zero Do XNew = XCurrent - BigMove 'set destination 1 inch minus X Code "G31 X" &XNew &" F" &FeedSlow 'Start hunt for edge While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec XPos2 = GetOEMDRO(800) 'get the touch X location ' XCenter = XPos2 - touchoffsetX 'Calculate the actual work_piece edge location Code "G01 X" &(XPos2+safeZ/4) &" F" &FeedFast 'rapid back away from touched surface While IsMoving() 'Wait for stop signal Sleep(1) 'Allow computer to run other tasks for 1ms Wend ' XAvg = Abs(Xpos1 - XCenter) 'do these positions differ ? XPos1 = XCenter 'update last reading LoopCount = LoopCount + 1 Loop Until((XAvg < max_error)Or(LoopCount > RetryLimit)) ' ZCurrent = GetOEMDRO(802) 'location of tool Z position Code "G01 Z" &(BigMove + ZCurrent) 'rapid move UP to the Z high position While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 X" &XCenter &" F" &FeedFast 'move to the work_piece X edge location While IsMoving () 'Wait for stop signal Sleep(1) Wend If (mymode = 14 Or cmd1 = 14)Then SetOEMDRO(800,0.000) 'Zero the X-DRO to the work_piece edge End If Code "G4 P0.25" 'Pause 1/4 sec ' ===== End Sub ' ========================================================= ' ========================================================= Sub Go_Mode_5 ' ========================================================= ' ========================================================= Rem === find the outside edge To plus Y === If mymode = 15 Then Code "(Mode 15: Find Y Max and set Y=0.0.)" Else Code "(Mode 5: Find Y Max and Show location)" End If Rem Move Probe Y Minus 'Move the probe in the Y minus direction until touch of workPiece YPos1 = 0 ' assume last position was zero YCurrent = GetOEMDRO(801) ' location of tool X position LoopCount = 0 ' set count to zero Do YNew = YCurrent - BigMove 'set destination 1 inch minus Y Code "G31 Y" &YNew &" F" &FeedSlow 'Start hunt for edge While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec YPos2 = GetOEMDRO(801) 'Get the Y touch location ' YCenter = (YPos2) - touchoffsetY 'Calculate the actual work_piece edge location Code "G01 Y" &(YPos2+safeZ/4) &" F" &FeedFast 'rapid move to the x center location While IsMoving() 'Wait for stop signal Sleep(1) Wend ' YAvg = Abs(Ypos1 - YCenter) ' do these positions differ YPos1 = YCenter LoopCount = LoopCount + 1 Loop Until((YAvg < max_error)Or(LoopCount > RetryLimit)) ' ZCurrent = GetOEMDRO(802) ' location of tool Z position Code "G01 Z" &(BigMove + ZCurrent)'rapid move to a safe Z height While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 Y" &YCenter &" F" &FeedFast 'move to the workpiece Y edge location While IsMoving () 'Wait for stop signal Sleep(1) Wend If (mymode = 15 Or cmd1 = 15)Then SetOEMDRO(801,0.000) 'Zero the Y-DRO to the work_piece edge End If Code "G4 P0.25" 'Pause 1/4 sec ' ===== End Sub ' ========================================================= ' ========================================================= Sub Go_Mode_6 ' ========================================================= ' ========================================================= Rem === find the top surface Z = Zero === Code "(Mode 6: Find Z Top and Set Z DRO to zero.)" Rem Assume probe is closer than one inch from finder surface Rem ========================== Rem === Move Probe Z Minus === Rem ========================== ZSave = ZTOP_GOAL ' Preset ideal location LoopCount = 0 ' set retry count to zero Do ' === take a reading === ZNew = (ZCurrent - BigMove) ' set destination -1" (down) Code "G31 Z" &ZNew &" F" &FeedSlow 'Start probe hunt for surface While IsMoving() 'Wait for stop signal Sleep(1) 'While waiting, let other tasks run Wend Code "G4 P0.500" 'Pause 0.5 sec Let user see touch ZAvg = Abs(GetOEMDRO(802) - ZSave) 'compare this reading with desired position ZSave = GetOEMDRO(802) 'save this reading is the new goal (Touching target) ' Code "G01 Z" &(ZSave + (safeZ/4)) &" F" &FeedFast 'rapid move to the (Z + 0.1") location While IsMoving() 'Wait for stop signal Sleep(1) 'While waiting, let other tasks run Wend 'An empty while/wend loop takes 100% of computer time ' LoopCount = LoopCount + 1 'update loop count ' Loop Until((ZAvg <= max_error)Or(LoopCount > RetryLimit)) ' loop again if ZAvg is grater than max_error ' ' or until retry limit is met ' done looping Code "G01 Z" &(ZSave) &" F" &FeedFast 'rapid move to the (Z + 0.75") location While IsMoving() 'Wait for stop signal Sleep(1) 'While waiting, let other tasks run Wend ' If (mymode = 6 Or cmd1 = 6 Or cmd1 = 8 Or mymode = 37 Or mymode = 8) Then SetOEMDRO(802,ZTOP_GOAL) 'Set the DRO display to be the desired Z position Code "G01 Z" &(BigMove*0.50 + ZTOP_GOAL) &" F" &FeedFast 'rapid move to the (Z + 0.75") location While IsMoving() 'Wait for stop signal Sleep(1) 'While waiting, let other tasks run Wend End If ' End Sub ' ========================================================= ' ========================================================= Sub Go_Mode_7 ' ========================================================= ' ========================================================= Rem === find the outside edge minus X, minus Y, And Z = 0 === Code "(Mode 7: Find Edgefinder and set X, Y, and Z DROs to zero.)" ' Must be within 1 inch of the corner over the work XCurrent = GetOEMDRO(800) ' location of tool X position YCurrent = GetOEMDRO(801) ' location of tool X position ZCurrent = GetOEMDRO(802) ' location of tool X position ' ' ======================== ' ===== First find Z ===== ' ======================== LoopCount = 0 ' set retry count to zero Do ' === take a reading === ZNew = ZCurrent - BigMove 'set destination -1" (down) Code "G31 Z" &ZNew &" F" &FeedSlow 'Start probe hunt for surface While IsMoving() 'Wait for stop signal Sleep(1) 'While waiting, let other tasks run Wend Code "G4 P0.200" 'Pause 0.2 sec Let user see touch ZAvg = Abs(GetOEMDRO(802) - ZTOP_GOAL) 'compare this reading with desired position ' SetOEMDRO(802,ZTOP_GOAL) 'Set the DRO display to be the desired Z position ZCurrent = ZTOP_GOAL ' Code "G01 Z" &(ZTOP_GOAL + safeZ/4) &" F" &FeedFast 'rapid move to the (Z + 0.1") location While IsMoving() 'Wait for stop signal Sleep(1) 'While waiting, let other tasks run Wend 'An empty while/wend loop takes 100% of computer time ' LoopCount = LoopCount + 1 'update loop count ' Loop Until((ZAvg <= max_error)Or(LoopCount > RetryLimit)) ' loop again if ZAvg is grater than max_error ' ' or until retry limit is met ' done looping: === ' Code "G01 Z" &(safeZ + ZCurrent) &" F" &FeedFast 'rapid move to safe height While IsMoving() 'Wait for stop signal Sleep(1) Wend ' ======================= ' ===== Then find X ===== ' ======================= Code "G01 Z" &(safeZ + ZCurrent) &" F" &FeedFast 'rapid move to safeZ location While IsMoving() 'Wait for stop signal Sleep(1) Wend XPos1 = 0 ' assume zero is correct XNew = XCurrent - BigMove 'back off X to a reasonable distance ' YNew = YCurrent + SIDE_Y*1.5 YNew = YCurrent Code "G01 X" &XNew &" Y" &YNew &" F" &FeedFast 'rapid move to the x starting location While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G31 Z" &(ZCurrent - SmallMove) &" F" &FeedSlow*3 'move to starting height While IsMoving() 'Wait for stop signal Sleep(1) Wend ' Code "G4 P0.1" 'Pause 100 msec ' === test for illegal touch === If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty Code "G01 Z" &(SafeZ+ZCurrent) &" F" &FeedFast 'move Z up to clear material While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 X" &(-BigMove * 0.5) &" F" &FeedFast 'rapid move to the y starting location While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G31 Z" &(ZCurrent-SmallMove) &" F" &FeedFast 'move Z down to starting height While IsMoving() 'Wait for stop signal Sleep(1) Wend End If ' Do XNew = XCurrent 'probe seek 1 inch to right Code "G31 X" &XNew &" F" &FeedSlow 'Start hunt for edge While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec XPos2 = GetOEMDRO(800) ' Get the X location ' XCenter = (XPos2) + touchoffsetX 'compensate for tool & finder edge Code "G01 X" &(XPos2-SmallMove/4) &" F" &FeedFast 'rapid back away from touched surface While IsMoving() 'Wait for stop signal Sleep(1) Wend ' XAvg = Abs(Xpos1 - XCenter) ' do these positions differ XPos1 = XCenter ' update Pos1 for next try LoopCount = LoopCount + 1 Loop Until((XAvg < max_error)Or(LoopCount > RetryLimit)) Code "G01 X" &(XPos2 -(SmallMove)) &" F" &FeedFast 'back off from work. don't scratch it. While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 Z" &(safeZ + ZCurrent) &" F" &FeedFast 'rapid move to the safeZ location While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 X" &XCenter &" F" &FeedFast 'rapid move to the workpiece X Edge location While IsMoving () 'Wait for stop signal Sleep(1) Wend SetOEMDRO(800,0.000) 'Set workpiece X edge to DRO zero XCurrent = 0.000 Code "G4 P0.25" 'Pause 1/4 sec ' ======================= ' ===== Then find Y ===== '======================== Code "G01 Z" &(safeZ+ZCurrent) &" F" &FeedFast 'rapid move to safeZ location While IsMoving() 'Wait for stop signal Sleep(1) Wend ' If mySide = 2 Then TEMP = SIDE_X * 2 Else TEMP = SIDE_X * 1.5 End If Code "G01 X" &(XCurrent+TEMP) &" F" &FeedFast 'rapid move to the x starting location While IsMoving() 'Wait for stop signal Sleep(1) Wend ' Code "G01 Y" &(YCurrent-BigMove) &" F" &FeedFast 'rapid move to the y starting location While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G31 Z" &(ZCurrent-(SmallMove)) &" F" &FeedSlow*3 'move Z down to starting height While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec ' === test for illegal touch === If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty Code "G01 Z" &(SafeZ) &" F" &FeedFast 'move Z up to clear material While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 Y" &(-BigMove * 0.5) &" F" &FeedFast 'rapid move to the y starting location While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G31 Z" &(ZCurrent-SmallMove) &" F" &FeedFast 'move Z down to starting height While IsMoving() 'Wait for stop signal Sleep(1) Wend End If ' Ypos1 = 0 LoopCount = 0 ' set count to zero Do YNew = YCurrent ' YCurrent is inside the edgefinder frame Code "G31 Y" &YNew &" F" &FeedSlow 'Start hunt for edge While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec YPos2 = GetOEMDRO(801) 'Get the Y location ' YCenter = YPos2 + touchoffsetY ' correct offset for tool thickness Code "G01 Y" &(YPos2-safeZ/4) &" F" &FeedFast 'rapid move to the x center location While IsMoving() 'Wait for stop signal Sleep(1) Wend ' YAvg = Abs(Ypos1 - YCenter) ' do these positions differ YPos1 = YCenter ' update last position LoopCount = LoopCount + 1 Loop Until((YAvg < max_error)Or(LoopCount > RetryLimit)) ' === we have a decent reading === Code "G01 Y" &(YPos2 -(SmallMove)) &" F" &FeedFast 'back off from work While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 Z" &(ZCurrent+safeZ) &" F" &FeedFast 'rapid move to the safeZ location While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G01 Y" &YCenter &" F" &FeedFast 'rapid move to the workpiece Y location While IsMoving () 'Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec SetOEMDRO(801,0.000) 'Set Y DRO to zero for workpiece edge Code "G4 P0.25" 'Pause 1/4 sec ' ========================== ' ===== Go to x0,y0,z0 ===== ' ========================== Code "G01 Z" &(ZCurrent+safeZ) &" F" &FeedFast 'rapid move to the safeZ location While IsMoving () 'Wait for stop signal Sleep(1) Wend Code "G01 X" &(0.000) &" F" &FeedFast 'rapid move to the x corner location While IsMoving () 'Wait for stop signal Sleep(1) Wend Code "G01 Y" &(0.000) &" F" &FeedFast 'rapid move to the y corner location While IsMoving () 'Wait for stop signal Sleep(1) Wend Code "G01 Z" &(ZTOP_GOAL) &" F" &FeedFast 'rapid move to the z corner location While IsMoving () 'Wait for stop signal Sleep(1) Wend ' Code "G4 P0.500" 'Pause 1/2 sec Code "G01 Z" &(ZCurrent + safeZ) &" F" &FeedFast 'rapid move to the safeZ location While IsMoving () 'Wait for stop signal Sleep(1) Wend ' ===== Function 7 Done =====End Sub End Sub ' ========================================================= ' ========================================================= Sub Go_Mode_8 ' ========================================================= ' ========================================================= Code "(Mode 8 Find Edgefinder and set X, Y, and Z DROs to zero.)" ' Must be over the hole & within 0.5inch of top XCurrent = GetOEMDRO(800) ' location of tool X position YCurrent = GetOEMDRO(801) ' location of tool Y position ZCurrent = GetOEMDRO(802) ' location of tool Z position ' ' ======================== ' ===== First find Z ===== ' ======================== LoopCount = 0 ' set retry count to zero Code "G31 Z" &(ZCurrent + SmallMove) &" F" &FeedSlow*3 'move to starting height While IsMoving() 'Wait for stop signal Sleep(1) Wend If(HoleSelected < 2) Then Code "G01 X" &(XCurrent + (BigMove/3)) &" F" &FeedFast 'rapid move to the x corner location Else Code "G01 X" &(XCurrent + (BigMove/1.5)) & "G01 Y" &(YCurrent - (BigMove/3)) &" F" &FeedFast 'rapid move to the x corner location End If ' While IsMoving () 'Wait for stop signal Sleep(1) Wend ' Go_Mode_6 '=== Z is zet to work-piece surface === ' Code "G01 X" &(XCurrent) & " Y" &(YCurrent) &" F" &FeedFast 'rapid move to the x corner location While IsMoving () 'Wait for stop signal Sleep(1) Wend ' If ZTOP_GOAL = 0 Then '=== Special case === Code "G31 Z" &(SmallMove/2) &" F" &FeedFast 'move to starting height While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G31 Z" &(-SmallMove) &" F" &FeedSlow 'move into hole While IsMoving() 'Wait for stop signal Sleep(1) Wend Code "G4 P0.1" 'Pause 100 msec ' Temp = GetOEMDRO(802) ' location of tool Z position ' If (Temp > (-SmallMove*(3/4))) Then If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty code "(No hole in material. Cannot continue.)" Code "G01 Z" &(ZTOP_GOAL + BigMove) &" F" &FeedFast 'rapid move to the (surface of finder) location While IsMoving() 'Wait for stop signal Sleep(1) 'While waiting, let other tasks run Wend 'An empty while/wend loop takes 100% of computer time Exit Sub End If Else ' === Standard case === Code "G31 Z" &(ZTOP_GOAL/5) &" F" &FeedFast 'move to starting height While IsMoving() 'Wait for stop signal Sleep(1) Wend End If ' Go_Mode_1 ' Do a center find; zeros not set ' Code "G01 Z" &(ZTOP_GOAL + safeZ) &" F" &FeedFast 'rapid move to the (surface of finder) location While IsMoving() 'Wait for stop signal Sleep(1) 'While waiting, let other tasks run Wend 'An empty while/wend loop takes 100% of computer time ' Code "G4 P0.1" 'Pause 100 msec If (HoleSelected = 1) Then SetOEMDRO(800,CENTER_X) ' Set X Offset SetOEMDRO(801,CENTER_Y) ' Set Y Offset ElseIf (HoleSelected = 2) Then SetOEMDRO(800,CNTR_2_X) ' Set X Offset SetOEMDRO(801,CNTR_2_Y) ' Set Y Offset Else SetOEMDRO(800,DefaultHoleX) ' Set X Offset SetOEMDRO(801,DefaultHoleY) ' Set Y Offset End If XCurrent = GetOEMDRO(800) ' location of tool X position YCurrent = GetOEMDRO(801) ' location of tool X position ZCurrent = GetOEMDRO(802) ' location of tool X position End Sub ' ' ========================================================= ' ========================================================= Sub Go_Mode_9 ' ========================================================= ' ========================================================= If (cmd2 = 9 And cmd3 = 9) Then HtmlDialog( GetMainFolder()+"Edge-Finder_Options.htm" ) End If End Sub ' ========================================================= ' ========================================================= Sub Go_Mode_100 ' === Three digit commands === ' ========================================================= ' ========================================================= If(cmd1 = 8) Then If(cmd3 <> 0) Then HoleSelected = cmd3 'select either small or large hole; small=0, large=1 End If rem Exit Sub End If ' If(cmd1 = 9) Then If(cmd2 = 9) Then If(cmd3 = 9) Then Exit Sub End If End If End If ' ' === Select the tool to be used === If (((cmd3 <= 0) Or (cmd3 > 4)) And (cmd1 <> 8)) Then toolSelected = DefaultTool/2 '=== Default tool Select === ElseIf (cmd3 = 1) Then toolSelected = tool_1/2 '=== Tool #1 === ElseIf (cmd3 = 2) Then toolSelected = tool_2/2 '=== Tool #2 === ElseIf (cmd3 = 3) Then toolSelected = tool_3/2 '=== Tool #3 === ElseIf (cmd3 = 4) Then myanswer = Question ("Sonden : 0=Standard") If (myanswer <=0) Then toolSelected = DefaultTool/2 '=== Default tool Select === Else toolSelected = (myanswer) /2 End If End If ' If cmd2 <= 0 Then '=== D E F A U L T E d g e === touchoffsetX = toolSelected + DefaultSideX ' Touch to edgefinder touchoffsetY = toolSelected + DefaultSideY ' Touch to edgefinder ZTOP_GOAL = DefaultHeight ElseIf cmd2 = 1 Then '=== S U R F A C E === touchoffsetX = toolSelected + 0.0 ' Touch to surface touchoffsetY = toolSelected + 0.0 ' Touch to surface ZTOP_GOAL = 0.000 ElseIf cmd2 = 2 Then '=== E D E G E F I N D E R === L O W T O P === touchoffsetX = toolSelected + SIDE_X ' Touch to edgefinder touchoffsetY = toolSelected + SIDE_Y ' Touch to edgefinder ZTOP_GOAL = Z_TOP1 ElseIf cmd2 = 3 Then '=== H I G H T O P === F C N #6 O N L Y === touchoffsetX = toolSelected + SIDE_X ' Touch to edgefinder touchoffsetY = toolSelected + SIDE_Y ' Touch to edgefinder ZTOP_GOAL = Z_TOP2 ElseIf cmd2 >= 4 Then '=== D E F A U L T E d g e === touchoffsetX = toolSelected + DefaultSideX ' Touch to surface touchoffsetY = toolSelected + DefaultSideY ' Touch to surface ZTOP_GOAL = DefaultHeight End If ' End Sub ' ========================================================= ' ========================================================= ' ' ========================================================= ' ========================================================= ' === E N D ==== E N D ==== E N D ==== E N D ==== E N D === ' ========================================================= ' ========================================================= Rem 2022/03/16 added 'in' or 'mm' to questions involving sizes Rem 2021/02/23 fixes to FCN8 for Z0 depth settings Rem 2020/07/22 added ZTOP_GOAL offse To FCN6 (5 lines from the End) To clear all brands of surface finders Rem 2020/06/20 added local help FCN 999 Rem 2020/04/10 activated 81x Rem 2020/03/31 activated #7, #16, #17, #27, #37, 100-833 Rem 2021/11/08 added small delay after G31 to let registers to settle Rem 2022/03/17 deutscher Befehlssatz von Winfried Kenter NoneAuto Tool Zero%+.4fNoneNone 7autom. Kantenfinder Bitmaps\hintergrund_codefenster.bmpNone%+.4f@